mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Merge branch 'master' into feature/show-secrets-option
This commit is contained in:
commit
c799bd094b
2
.github/workflows/backport_branches.yml
vendored
2
.github/workflows/backport_branches.yml
vendored
@ -549,7 +549,7 @@ jobs:
|
||||
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
|
||||
sudo rm -fr "$TEMP_PATH"
|
||||
InstallPackagesTestAarch64:
|
||||
needs: [BuilderDebRelease]
|
||||
needs: [BuilderDebAarch64]
|
||||
runs-on: [self-hosted, style-checker-aarch64]
|
||||
steps:
|
||||
- name: Set envs
|
||||
|
4
.github/workflows/docs_check.yml
vendored
4
.github/workflows/docs_check.yml
vendored
@ -13,9 +13,11 @@ on: # yamllint disable-line rule:truthy
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'CHANGELOG.md'
|
||||
- 'README.md'
|
||||
- 'SECURITY.md'
|
||||
- 'docker/docs/**'
|
||||
- 'docs/**'
|
||||
- 'website/**'
|
||||
- 'utils/check-style/aspell-ignore/**'
|
||||
jobs:
|
||||
CheckLabels:
|
||||
|
118
.github/workflows/docs_release.yml
vendored
118
.github/workflows/docs_release.yml
vendored
@ -1,118 +0,0 @@
|
||||
name: DocsReleaseChecks
|
||||
|
||||
env:
|
||||
# Force the stdout and stderr streams to be unbuffered
|
||||
PYTHONUNBUFFERED: 1
|
||||
|
||||
concurrency:
|
||||
group: master-release
|
||||
cancel-in-progress: true
|
||||
'on':
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/**'
|
||||
- 'docker/docs/release/**'
|
||||
- 'docs/**'
|
||||
- 'utils/list-versions/version_date.tsv'
|
||||
- 'website/**'
|
||||
- 'utils/check-style/aspell-ignore/**'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
DockerHubPushAarch64:
|
||||
runs-on: [self-hosted, style-checker-aarch64]
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: ClickHouse/checkout@v1
|
||||
with:
|
||||
clear-repository: true
|
||||
- name: Images check
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE/tests/ci"
|
||||
python3 docker_images_check.py --suffix aarch64
|
||||
- name: Upload images files to artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: changed_images_aarch64
|
||||
path: ${{ runner.temp }}/docker_images_check/changed_images_aarch64.json
|
||||
DockerHubPushAmd64:
|
||||
runs-on: [self-hosted, style-checker]
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: ClickHouse/checkout@v1
|
||||
with:
|
||||
clear-repository: true
|
||||
- name: Images check
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE/tests/ci"
|
||||
python3 docker_images_check.py --suffix amd64
|
||||
- name: Upload images files to artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: changed_images_amd64
|
||||
path: ${{ runner.temp }}/docker_images_check/changed_images_amd64.json
|
||||
DockerHubPush:
|
||||
needs: [DockerHubPushAmd64, DockerHubPushAarch64]
|
||||
runs-on: [self-hosted, style-checker]
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: ClickHouse/checkout@v1
|
||||
with:
|
||||
clear-repository: true
|
||||
- name: Download changed aarch64 images
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: changed_images_aarch64
|
||||
path: ${{ runner.temp }}
|
||||
- name: Download changed amd64 images
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: changed_images_amd64
|
||||
path: ${{ runner.temp }}
|
||||
- name: Images check
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE/tests/ci"
|
||||
python3 docker_manifests_merge.py --suffix amd64 --suffix aarch64
|
||||
- name: Upload images files to artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: changed_images
|
||||
path: ${{ runner.temp }}/changed_images.json
|
||||
DocsRelease:
|
||||
needs: DockerHubPush
|
||||
runs-on: [self-hosted, func-tester]
|
||||
steps:
|
||||
- name: Set envs
|
||||
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#multiline-strings
|
||||
run: |
|
||||
cat >> "$GITHUB_ENV" << 'EOF'
|
||||
TEMP_PATH=${{runner.temp}}/docs_release
|
||||
REPO_COPY=${{runner.temp}}/docs_release/ClickHouse
|
||||
CLOUDFLARE_TOKEN=${{secrets.CLOUDFLARE}}
|
||||
ROBOT_CLICKHOUSE_SSH_KEY<<RCSK
|
||||
${{secrets.ROBOT_CLICKHOUSE_SSH_KEY}}
|
||||
RCSK
|
||||
EOF
|
||||
- name: Check out repository code
|
||||
uses: ClickHouse/checkout@v1
|
||||
with:
|
||||
clear-repository: true
|
||||
- name: Download changed images
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: changed_images
|
||||
path: ${{ env.TEMP_PATH }}
|
||||
- name: Docs Release
|
||||
run: |
|
||||
sudo rm -fr "$TEMP_PATH"
|
||||
mkdir -p "$TEMP_PATH"
|
||||
cp -r "$GITHUB_WORKSPACE" "$TEMP_PATH"
|
||||
cd "$REPO_COPY/tests/ci"
|
||||
python3 docs_release.py
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: |
|
||||
docker ps --quiet | xargs --no-run-if-empty docker kill ||:
|
||||
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
|
||||
sudo rm -fr "$TEMP_PATH"
|
2
.github/workflows/master.yml
vendored
2
.github/workflows/master.yml
vendored
@ -983,7 +983,7 @@ jobs:
|
||||
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
|
||||
sudo rm -fr "$TEMP_PATH"
|
||||
InstallPackagesTestAarch64:
|
||||
needs: [BuilderDebRelease]
|
||||
needs: [BuilderDebAarch64]
|
||||
runs-on: [self-hosted, style-checker-aarch64]
|
||||
steps:
|
||||
- name: Set envs
|
||||
|
4
.github/workflows/nightly.yml
vendored
4
.github/workflows/nightly.yml
vendored
@ -107,7 +107,7 @@ jobs:
|
||||
run: |
|
||||
curl --form token="${COVERITY_TOKEN}" \
|
||||
--form email='security+coverity@clickhouse.com' \
|
||||
--form file="@$TEMP_PATH/$BUILD_NAME/coverity-scan.tar.zst" \
|
||||
--form file="@$TEMP_PATH/$BUILD_NAME/coverity-scan.tar.gz" \
|
||||
--form version="${GITHUB_REF#refs/heads/}-${GITHUB_SHA::6}" \
|
||||
--form description="Nighly Scan: $(date +'%Y-%m-%dT%H:%M:%S')" \
|
||||
https://scan.coverity.com/builds?project=ClickHouse%2FClickHouse
|
||||
@ -154,7 +154,7 @@ jobs:
|
||||
- name: Set Up Build Tools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -yq git cmake ccache python3 ninja-build
|
||||
sudo apt-get install -yq git cmake ccache ninja-build python3 yasm
|
||||
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
|
||||
- name: Run build-wrapper
|
||||
run: |
|
||||
|
6
.github/workflows/pull_request.yml
vendored
6
.github/workflows/pull_request.yml
vendored
@ -13,9 +13,11 @@ on: # yamllint disable-line rule:truthy
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'CHANGELOG.md'
|
||||
- 'README.md'
|
||||
- 'SECURITY.md'
|
||||
- 'docker/docs/**'
|
||||
- 'docs/**'
|
||||
- 'website/**'
|
||||
- 'utils/check-style/aspell-ignore/**'
|
||||
##########################################################################################
|
||||
##################################### SMALL CHECKS #######################################
|
||||
@ -1021,7 +1023,7 @@ jobs:
|
||||
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
|
||||
sudo rm -fr "$TEMP_PATH"
|
||||
InstallPackagesTestAarch64:
|
||||
needs: [BuilderDebRelease]
|
||||
needs: [BuilderDebAarch64]
|
||||
runs-on: [self-hosted, style-checker-aarch64]
|
||||
steps:
|
||||
- name: Set envs
|
||||
|
2
.github/workflows/release_branches.yml
vendored
2
.github/workflows/release_branches.yml
vendored
@ -641,7 +641,7 @@ jobs:
|
||||
docker ps --all --quiet | xargs --no-run-if-empty docker rm -f ||:
|
||||
sudo rm -fr "$TEMP_PATH"
|
||||
InstallPackagesTestAarch64:
|
||||
needs: [BuilderDebRelease]
|
||||
needs: [BuilderDebAarch64]
|
||||
runs-on: [self-hosted, style-checker-aarch64]
|
||||
steps:
|
||||
- name: Set envs
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -161,6 +161,7 @@ website/package-lock.json
|
||||
tests/queries/0_stateless/test_*
|
||||
tests/queries/0_stateless/*.binary
|
||||
tests/queries/0_stateless/*.generated-expect
|
||||
tests/queries/0_stateless/*.expect.history
|
||||
|
||||
# rust
|
||||
/rust/**/target
|
||||
|
183
CHANGELOG.md
183
CHANGELOG.md
@ -1,9 +1,192 @@
|
||||
### Table of Contents
|
||||
**[ClickHouse release v23.2, 2023-02-23](#232)**<br/>
|
||||
**[ClickHouse release v23.1, 2023-01-25](#231)**<br/>
|
||||
**[Changelog for 2022](https://clickhouse.com/docs/en/whats-new/changelog/2022/)**<br/>
|
||||
|
||||
# 2023 Changelog
|
||||
|
||||
### <a id="232"></a> ClickHouse release 23.2, 2023-02-23
|
||||
|
||||
#### Backward Incompatible Change
|
||||
* Extend function "toDayOfWeek()" (alias: "DAYOFWEEK") with a mode argument that encodes whether the week starts on Monday or Sunday and whether counting starts at 0 or 1. For consistency with other date time functions, the mode argument was inserted between the time and the time zone arguments. This breaks existing usage of the (previously undocumented) 2-argument syntax "toDayOfWeek(time, time_zone)". A fix is to rewrite the function into "toDayOfWeek(time, 0, time_zone)". [#45233](https://github.com/ClickHouse/ClickHouse/pull/45233) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Rename setting `max_query_cache_size` to `filesystem_cache_max_download_size`. [#45614](https://github.com/ClickHouse/ClickHouse/pull/45614) ([Kseniia Sumarokova](https://github.com/kssenii)).
|
||||
* The `default` user will not have permissions for access type `SHOW NAMED COLLECTION` by default (e.g. `default` user will no longer be able to grant ALL to other users as it was before, therefore this PR is backward incompatible). [#46010](https://github.com/ClickHouse/ClickHouse/pull/46010) ([Kseniia Sumarokova](https://github.com/kssenii)).
|
||||
* If the SETTINGS clause is specified before the FORMAT clause, the settings will be applied to formatting as well. [#46003](https://github.com/ClickHouse/ClickHouse/pull/46003) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Remove support for setting `materialized_postgresql_allow_automatic_update` (which was by default turned off). [#46106](https://github.com/ClickHouse/ClickHouse/pull/46106) ([Kseniia Sumarokova](https://github.com/kssenii)).
|
||||
* Slightly improve performance of `countDigits` on realistic datasets. This closed [#44518](https://github.com/ClickHouse/ClickHouse/issues/44518). In previous versions, `countDigits(0)` returned `0`; now it returns `1`, which is more correct, and follows the existing documentation. [#46187](https://github.com/ClickHouse/ClickHouse/pull/46187) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* Disallow creation of new columns compressed by a combination of codecs "Delta" or "DoubleDelta" followed by codecs "Gorilla" or "FPC". This can be bypassed using setting "allow_suspicious_codecs = true". [#45652](https://github.com/ClickHouse/ClickHouse/pull/45652) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
|
||||
#### New Feature
|
||||
* Add `StorageIceberg` and table function `iceberg` to access iceberg table store on S3. [#45384](https://github.com/ClickHouse/ClickHouse/pull/45384) ([flynn](https://github.com/ucasfl)).
|
||||
* Allow configuring storage as `SETTINGS disk = '<disk_name>'` (instead of `storage_policy`) and with explicit disk creation `SETTINGS disk = disk(type=s3, ...)`. [#41976](https://github.com/ClickHouse/ClickHouse/pull/41976) ([Kseniia Sumarokova](https://github.com/kssenii)).
|
||||
* Expose `ProfileEvents` counters in `system.part_log`. [#38614](https://github.com/ClickHouse/ClickHouse/pull/38614) ([Bharat Nallan](https://github.com/bharatnc)).
|
||||
* Enrichment of the existing `ReplacingMergeTree` engine to allow duplicate the insertion. It leverages the power of both `ReplacingMergeTree` and `CollapsingMergeTree` in one MergeTree engine. Deleted data are not returned when queried, but not removed from disk neither. [#41005](https://github.com/ClickHouse/ClickHouse/pull/41005) ([youennL-cs](https://github.com/youennL-cs)).
|
||||
* Add `generateULID` function. Closes [#36536](https://github.com/ClickHouse/ClickHouse/issues/36536). [#44662](https://github.com/ClickHouse/ClickHouse/pull/44662) ([Nikolay Degterinsky](https://github.com/evillique)).
|
||||
* Add `corrMatrix` aggregate function, calculating each two columns. In addition, since Aggregatefunctions `covarSamp` and `covarPop` are similar to `corr`, I add `covarSampMatrix`, `covarPopMatrix` by the way. @alexey-milovidov closes [#44587](https://github.com/ClickHouse/ClickHouse/issues/44587). [#44680](https://github.com/ClickHouse/ClickHouse/pull/44680) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)).
|
||||
* Introduce arrayShuffle function for random array permutations. [#45271](https://github.com/ClickHouse/ClickHouse/pull/45271) ([Joanna Hulboj](https://github.com/jh0x)).
|
||||
* Support types `FIXED_SIZE_BINARY` type in Arrow, `FIXED_LENGTH_BYTE_ARRAY` in `Parquet` and match them to `FixedString`. Add settings `output_format_parquet_fixed_string_as_fixed_byte_array/output_format_arrow_fixed_string_as_fixed_byte_array` to control default output type for FixedString. Closes [#45326](https://github.com/ClickHouse/ClickHouse/issues/45326). [#45340](https://github.com/ClickHouse/ClickHouse/pull/45340) ([Kruglov Pavel](https://github.com/Avogar)).
|
||||
* Add a new column `last_exception_time` to system.replication_queue. [#45457](https://github.com/ClickHouse/ClickHouse/pull/45457) ([Frank Chen](https://github.com/FrankChen021)).
|
||||
* Add two new functions which allow for user-defined keys/seeds with SipHash{64,128}. [#45513](https://github.com/ClickHouse/ClickHouse/pull/45513) ([Salvatore Mesoraca](https://github.com/aiven-sal)).
|
||||
* Allow a three-argument version for table function `format`. close [#45808](https://github.com/ClickHouse/ClickHouse/issues/45808). [#45873](https://github.com/ClickHouse/ClickHouse/pull/45873) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)).
|
||||
* Add `JodaTime` format support for 'x','w','S'. Refer to https://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html. [#46073](https://github.com/ClickHouse/ClickHouse/pull/46073) ([zk_kiger](https://github.com/zk-kiger)).
|
||||
* Support window function `ntile`. ([lgbo](https://github.com/lgbo-ustc)).
|
||||
* Add setting `final` to implicitly apply the `FINAL` modifier to every table. [#40945](https://github.com/ClickHouse/ClickHouse/pull/40945) ([Arthur Passos](https://github.com/arthurpassos)).
|
||||
* Added `arrayPartialSort` and `arrayPartialReverseSort` functions. [#46296](https://github.com/ClickHouse/ClickHouse/pull/46296) ([Joanna Hulboj](https://github.com/jh0x)).
|
||||
* The new http parameter `client_protocol_version` allows setting a client protocol version for HTTP responses using the Native format. [#40397](https://github.com/ClickHouse/ClickHouse/issues/40397). [#46360](https://github.com/ClickHouse/ClickHouse/pull/46360) ([Geoff Genz](https://github.com/genzgd)).
|
||||
* Add new function `regexpExtract`, like spark function `REGEXP_EXTRACT` for compatibility. It is similar to the existing function `extract`. [#46469](https://github.com/ClickHouse/ClickHouse/pull/46469) ([李扬](https://github.com/taiyang-li)).
|
||||
* Add new function `JSONArrayLength`, which returns the number of elements in the outermost JSON array. The function returns NULL if the input JSON string is invalid. [#46631](https://github.com/ClickHouse/ClickHouse/pull/46631) ([李扬](https://github.com/taiyang-li)).
|
||||
|
||||
#### Performance Improvement
|
||||
* The introduced logic works if PREWHERE condition is a conjunction of multiple conditions (cond1 AND cond2 AND ... ). It groups those conditions that require reading the same columns into steps. After each step the corresponding part of the full condition is computed and the result rows might be filtered. This allows to read fewer rows in the next steps thus saving IO bandwidth and doing less computation. This logic is disabled by default for now. It will be enabled by default in one of the future releases once it is known to not have any regressions, so it is highly encouraged to be used for testing. It can be controlled by 2 settings: "enable_multiple_prewhere_read_steps" and "move_all_conditions_to_prewhere". [#46140](https://github.com/ClickHouse/ClickHouse/pull/46140) ([Alexander Gololobov](https://github.com/davenger)).
|
||||
* An option added to aggregate partitions independently if table partition key and group by key are compatible. Controlled by the setting `allow_aggregate_partitions_independently`. Disabled by default because of limited applicability (please refer to the docs). [#45364](https://github.com/ClickHouse/ClickHouse/pull/45364) ([Nikita Taranov](https://github.com/nickitat)).
|
||||
* Allow using Vertical merge algorithm with parts in Compact format. This will allow ClickHouse server to use much less memory for background operations. This closes [#46084](https://github.com/ClickHouse/ClickHouse/issues/46084). [#45681](https://github.com/ClickHouse/ClickHouse/pull/45681) [#46282](https://github.com/ClickHouse/ClickHouse/pull/46282) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Optimize `Parquet` reader by using batch reader. [#45878](https://github.com/ClickHouse/ClickHouse/pull/45878) ([LiuNeng](https://github.com/liuneng1994)).
|
||||
* Add new `local_filesystem_read_method` method `io_uring` based on the asynchronous Linux [io_uring](https://kernel.dk/io_uring.pdf) subsystem, improving read performance almost universally compared to the default `pread` method. [#38456](https://github.com/ClickHouse/ClickHouse/pull/38456) ([Saulius Valatka](https://github.com/sauliusvl)).
|
||||
* Rewrite aggregate functions with `if` expression as argument when logically equivalent. For example, `avg(if(cond, col, null))` can be rewritten to avgIf(cond, col). It is helpful in performance. [#44730](https://github.com/ClickHouse/ClickHouse/pull/44730) ([李扬](https://github.com/taiyang-li)).
|
||||
* Improve lower/upper function performance with avx512 instructions. [#37894](https://github.com/ClickHouse/ClickHouse/pull/37894) ([yaqi-zhao](https://github.com/yaqi-zhao)).
|
||||
* Remove the limitation that on systems with >=32 cores and SMT disabled ClickHouse uses only half of the cores (the case when you disable Hyper Threading in BIOS). [#44973](https://github.com/ClickHouse/ClickHouse/pull/44973) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Improve performance of function `multiIf` by columnar executing, speed up by 2.3x. [#45296](https://github.com/ClickHouse/ClickHouse/pull/45296) ([李扬](https://github.com/taiyang-li)).
|
||||
* Add fast path for function `position` when the needle is empty. [#45382](https://github.com/ClickHouse/ClickHouse/pull/45382) ([李扬](https://github.com/taiyang-li)).
|
||||
* Enable `query_plan_remove_redundant_sorting` optimization by default. Optimization implemented in [#45420](https://github.com/ClickHouse/ClickHouse/issues/45420). [#45567](https://github.com/ClickHouse/ClickHouse/pull/45567) ([Igor Nikonov](https://github.com/devcrafter)).
|
||||
* Increased HTTP Transfer Encoding chunk size to improve performance of large queries using the HTTP interface. [#45593](https://github.com/ClickHouse/ClickHouse/pull/45593) ([Geoff Genz](https://github.com/genzgd)).
|
||||
* Fixed performance of short `SELECT` queries that read from tables with large number of `Array`/`Map`/`Nested` columns. [#45630](https://github.com/ClickHouse/ClickHouse/pull/45630) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Improve performance of filtering for big integers and decimal types. [#45949](https://github.com/ClickHouse/ClickHouse/pull/45949) ([李扬](https://github.com/taiyang-li)).
|
||||
* This change could effectively reduce the overhead of obtaining the filter from ColumnNullable(UInt8) and improve the overall query performance. To evaluate the impact of this change, we adopted TPC-H benchmark but revised the column types from non-nullable to nullable, and we measured the QPS of its queries as the performance indicator. [#45962](https://github.com/ClickHouse/ClickHouse/pull/45962) ([Zhiguo Zhou](https://github.com/ZhiguoZh)).
|
||||
* Make the `_part` and `_partition_id` virtual column be `LowCardinality(String)` type. Closes [#45964](https://github.com/ClickHouse/ClickHouse/issues/45964). [#45975](https://github.com/ClickHouse/ClickHouse/pull/45975) ([flynn](https://github.com/ucasfl)).
|
||||
* Improve the performance of Decimal conversion when the scale does not change. [#46095](https://github.com/ClickHouse/ClickHouse/pull/46095) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* Allow to increase prefetching for read data. [#46168](https://github.com/ClickHouse/ClickHouse/pull/46168) ([Kseniia Sumarokova](https://github.com/kssenii)).
|
||||
* Rewrite `arrayExists(x -> x = 1, arr)` -> `has(arr, 1)`, which improve performance by 1.34x. [#46188](https://github.com/ClickHouse/ClickHouse/pull/46188) ([李扬](https://github.com/taiyang-li)).
|
||||
* Fix too big memory usage for vertical merges on non-remote disk. Respect `max_insert_delayed_streams_for_parallel_write` for the remote disk. [#46275](https://github.com/ClickHouse/ClickHouse/pull/46275) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
|
||||
* Update zstd to v1.5.4. It has some minor improvements in performance and compression ratio. If you run replicas with different versions of ClickHouse you may see reasonable error messages `Data after merge/mutation is not byte-identical to data on another replicas.` with explanation. These messages are Ok and you should not worry. [#46280](https://github.com/ClickHouse/ClickHouse/pull/46280) ([Raúl Marín](https://github.com/Algunenano)).
|
||||
* Fix performance degradation caused by [#39737](https://github.com/ClickHouse/ClickHouse/issues/39737). [#46309](https://github.com/ClickHouse/ClickHouse/pull/46309) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* The `replicas_status` handle will answer quickly even in case of a large replication queue. [#46310](https://github.com/ClickHouse/ClickHouse/pull/46310) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* Add avx512 support for aggregate function `sum`, function unary arithmetic, function comparison. [#37870](https://github.com/ClickHouse/ClickHouse/pull/37870) ([zhao zhou](https://github.com/zzachimed)).
|
||||
* Rewrote the code around marks distribution and the overall coordination of the reading in order to achieve the maximum performance improvement. This closes [#34527](https://github.com/ClickHouse/ClickHouse/issues/34527). [#43772](https://github.com/ClickHouse/ClickHouse/pull/43772) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
|
||||
* Remove redundant DISTINCT clauses in query (subqueries). Implemented on top of query plan. It does similar optimization as `optimize_duplicate_order_by_and_distinct` regarding DISTINCT clauses. Can be enabled via `query_plan_remove_redundant_distinct` setting. Related to [#42648](https://github.com/ClickHouse/ClickHouse/issues/42648). [#44176](https://github.com/ClickHouse/ClickHouse/pull/44176) ([Igor Nikonov](https://github.com/devcrafter)).
|
||||
* A few query rewrite optimizations: `sumIf(123, cond) -> 123 * countIf(1, cond)`, `sum(if(cond, 123, 0)) -> 123 * countIf(cond)`, `sum(if(cond, 0, 123)) -> 123 * countIf(not(cond))` [#44728](https://github.com/ClickHouse/ClickHouse/pull/44728) ([李扬](https://github.com/taiyang-li)).
|
||||
* Improved how memory bound merging and aggregation in order on top query plan interact. Previously we fell back to explicit sorting for AIO in some cases when it wasn't actually needed. [#45892](https://github.com/ClickHouse/ClickHouse/pull/45892) ([Nikita Taranov](https://github.com/nickitat)).
|
||||
* Concurrent merges are scheduled using round-robin by default to ensure fair and starvation-free operation. Previously in heavily overloaded shards, big merges could possibly be starved by smaller merges due to the use of strict priority scheduling. Added `background_merges_mutations_scheduling_policy` server config option to select scheduling algorithm (`round_robin` or `shortest_task_first`). [#46247](https://github.com/ClickHouse/ClickHouse/pull/46247) ([Sergei Trifonov](https://github.com/serxa)).
|
||||
|
||||
#### Improvement
|
||||
* Enable retries for INSERT by default in case of ZooKeeper session loss. We already use it in production. [#46308](https://github.com/ClickHouse/ClickHouse/pull/46308) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* Add ability to ignore unknown keys in JSON object for named tuples (`input_format_json_ignore_unknown_keys_in_named_tuple`). [#45678](https://github.com/ClickHouse/ClickHouse/pull/45678) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Support optimizing the `where` clause with sorting key expression move to `prewhere` for query with `final`. [#38893](https://github.com/ClickHouse/ClickHouse/issues/38893). [#38950](https://github.com/ClickHouse/ClickHouse/pull/38950) ([hexiaoting](https://github.com/hexiaoting)).
|
||||
* Add new metrics for backups: num_processed_files and processed_files_size described actual number of processed files. [#42244](https://github.com/ClickHouse/ClickHouse/pull/42244) ([Aleksandr](https://github.com/AVMusorin)).
|
||||
* Added retries on interserver DNS errors. [#43179](https://github.com/ClickHouse/ClickHouse/pull/43179) ([Anton Kozlov](https://github.com/tonickkozlov)).
|
||||
* Keeper improvement: try preallocating space on the disk to avoid undefined out-of-space issues. Introduce setting `max_log_file_size` for the maximum size of Keeper's Raft log files. [#44370](https://github.com/ClickHouse/ClickHouse/pull/44370) ([Antonio Andelic](https://github.com/antonio2368)).
|
||||
* Optimize behavior for a replica delay api logic in case the replica is read-only. [#45148](https://github.com/ClickHouse/ClickHouse/pull/45148) ([mateng915](https://github.com/mateng0915)).
|
||||
* Ask for the password in clickhouse-client interactively in a case when the empty password is wrong. Closes [#46702](https://github.com/ClickHouse/ClickHouse/issues/46702). [#46730](https://github.com/ClickHouse/ClickHouse/pull/46730) ([Nikolay Degterinsky](https://github.com/evillique)).
|
||||
* Mark `Gorilla` compression on columns of non-Float* type as suspicious. [#45376](https://github.com/ClickHouse/ClickHouse/pull/45376) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Show replica name that is executing a merge in the `postpone_reason` column. [#45458](https://github.com/ClickHouse/ClickHouse/pull/45458) ([Frank Chen](https://github.com/FrankChen021)).
|
||||
* Save exception stack trace in part_log. [#45459](https://github.com/ClickHouse/ClickHouse/pull/45459) ([Frank Chen](https://github.com/FrankChen021)).
|
||||
* The `regexp_tree` dictionary is polished and now it is compatible with https://github.com/ua-parser/uap-core. [#45631](https://github.com/ClickHouse/ClickHouse/pull/45631) ([Han Fei](https://github.com/hanfei1991)).
|
||||
* Updated checking of `SYSTEM SYNC REPLICA`, resolves [#45508](https://github.com/ClickHouse/ClickHouse/issues/45508) [#45648](https://github.com/ClickHouse/ClickHouse/pull/45648) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
|
||||
* Rename setting `replication_alter_partitions_sync` to `alter_sync`. [#45659](https://github.com/ClickHouse/ClickHouse/pull/45659) ([Antonio Andelic](https://github.com/antonio2368)).
|
||||
* The `generateRandom` table function and the engine now support `LowCardinality` data types. This is useful for testing, for example you can write `INSERT INTO table SELECT * FROM generateRandom() LIMIT 1000`. This is needed to debug [#45590](https://github.com/ClickHouse/ClickHouse/issues/45590). [#45661](https://github.com/ClickHouse/ClickHouse/pull/45661) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* The experimental query result cache now provides more modular configuration settings. [#45679](https://github.com/ClickHouse/ClickHouse/pull/45679) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Renamed "query result cache" to "query cache". [#45682](https://github.com/ClickHouse/ClickHouse/pull/45682) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* add `SYSTEM SYNC FILE CACHE` command. It will do the `sync` syscall. [#8921](https://github.com/ClickHouse/ClickHouse/issues/8921). [#45685](https://github.com/ClickHouse/ClickHouse/pull/45685) ([DR](https://github.com/freedomDR)).
|
||||
* Add a new S3 setting `allow_head_object_request`. This PR makes usage of `GetObjectAttributes` request instead of `HeadObject` introduced in https://github.com/ClickHouse/ClickHouse/pull/45288 optional (and disabled by default). [#45701](https://github.com/ClickHouse/ClickHouse/pull/45701) ([Vitaly Baranov](https://github.com/vitlibar)).
|
||||
* Add ability to override connection settings based on connection names (that said that now you can forget about storing password for each connection, you can simply put everything into `~/.clickhouse-client/config.xml` and even use different history files for them, which can be also useful). [#45715](https://github.com/ClickHouse/ClickHouse/pull/45715) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Arrow format: support the duration type. Closes [#45669](https://github.com/ClickHouse/ClickHouse/issues/45669). [#45750](https://github.com/ClickHouse/ClickHouse/pull/45750) ([flynn](https://github.com/ucasfl)).
|
||||
* Extend the logging in the Query Cache to improve investigations of the caching behavior. [#45751](https://github.com/ClickHouse/ClickHouse/pull/45751) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* The query cache's server-level settings are now reconfigurable at runtime. [#45758](https://github.com/ClickHouse/ClickHouse/pull/45758) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Hide password in logs when a table function's arguments are specified with a named collection. [#45774](https://github.com/ClickHouse/ClickHouse/pull/45774) ([Vitaly Baranov](https://github.com/vitlibar)).
|
||||
* Improve internal S3 client to correctly deduce regions and redirections for different types of URLs. [#45783](https://github.com/ClickHouse/ClickHouse/pull/45783) ([Antonio Andelic](https://github.com/antonio2368)).
|
||||
* Add support for Map, IPv4 and IPv6 types in generateRandom. Mostly useful for testing. [#45785](https://github.com/ClickHouse/ClickHouse/pull/45785) ([Raúl Marín](https://github.com/Algunenano)).
|
||||
* Support empty/notEmpty for IP types. [#45799](https://github.com/ClickHouse/ClickHouse/pull/45799) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
|
||||
* The column `num_processed_files` was split into two columns: `num_files` (for BACKUP) and `files_read` (for RESTORE). The column `processed_files_size` was split into two columns: `total_size` (for BACKUP) and `bytes_read` (for RESTORE). [#45800](https://github.com/ClickHouse/ClickHouse/pull/45800) ([Vitaly Baranov](https://github.com/vitlibar)).
|
||||
* Add support for `SHOW ENGINES` query for MySQL compatibility. [#45859](https://github.com/ClickHouse/ClickHouse/pull/45859) ([Filatenkov Artur](https://github.com/FArthur-cmd)).
|
||||
* Improved how the obfuscator deals with queries. [#45867](https://github.com/ClickHouse/ClickHouse/pull/45867) ([Raúl Marín](https://github.com/Algunenano)).
|
||||
* Improve behaviour of conversion into Date for boundary value 65535 (2149-06-06). [#46042](https://github.com/ClickHouse/ClickHouse/pull/46042) [#45914](https://github.com/ClickHouse/ClickHouse/pull/45914) ([Joanna Hulboj](https://github.com/jh0x)).
|
||||
* Add setting `check_referential_table_dependencies` to check referential dependencies on `DROP TABLE`. This PR solves [#38326](https://github.com/ClickHouse/ClickHouse/issues/38326). [#45936](https://github.com/ClickHouse/ClickHouse/pull/45936) ([Vitaly Baranov](https://github.com/vitlibar)).
|
||||
* Fix `tupleElement` to return `Null` when having `Null` argument. Closes [#45894](https://github.com/ClickHouse/ClickHouse/issues/45894). [#45952](https://github.com/ClickHouse/ClickHouse/pull/45952) ([flynn](https://github.com/ucasfl)).
|
||||
* Throw an error on no files satisfying the S3 wildcard. Closes [#45587](https://github.com/ClickHouse/ClickHouse/issues/45587). [#45957](https://github.com/ClickHouse/ClickHouse/pull/45957) ([chen](https://github.com/xiedeyantu)).
|
||||
* Use cluster state data to check concurrent backup/restore. [#45982](https://github.com/ClickHouse/ClickHouse/pull/45982) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
|
||||
* ClickHouse Client: Use "exact" matching for fuzzy search, which has correct case ignorance and more appropriate algorithm for matching SQL queries. [#46000](https://github.com/ClickHouse/ClickHouse/pull/46000) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Forbid wrong create View syntax `CREATE View X TO Y AS SELECT`. Closes [#4331](https://github.com/ClickHouse/ClickHouse/issues/4331). [#46043](https://github.com/ClickHouse/ClickHouse/pull/46043) ([flynn](https://github.com/ucasfl)).
|
||||
* Storage `Log` family support setting the `storage_policy`. Closes [#43421](https://github.com/ClickHouse/ClickHouse/issues/43421). [#46044](https://github.com/ClickHouse/ClickHouse/pull/46044) ([flynn](https://github.com/ucasfl)).
|
||||
* Improve `JSONColumns` format when the result is empty. Closes [#46024](https://github.com/ClickHouse/ClickHouse/issues/46024). [#46053](https://github.com/ClickHouse/ClickHouse/pull/46053) ([flynn](https://github.com/ucasfl)).
|
||||
* Add reference implementation for SipHash128. [#46065](https://github.com/ClickHouse/ClickHouse/pull/46065) ([Salvatore Mesoraca](https://github.com/aiven-sal)).
|
||||
* Add a new metric to record allocations times and bytes using mmap. [#46068](https://github.com/ClickHouse/ClickHouse/pull/46068) ([李扬](https://github.com/taiyang-li)).
|
||||
* Currently for functions like `leftPad`, `rightPad`, `leftPadUTF8`, `rightPadUTF8`, the second argument `length` must be UInt8|16|32|64|128|256. Which is too strict for clickhouse users, besides, it is not consistent with other similar functions like `arrayResize`, `substring` and so on. [#46103](https://github.com/ClickHouse/ClickHouse/pull/46103) ([李扬](https://github.com/taiyang-li)).
|
||||
* Fix assertion in the `welchTTest` function in debug build when the resulting statistics is NaN. Unified the behavior with other similar functions. Change the behavior of `studentTTest` to return NaN instead of throwing an exception because the previous behavior was inconvenient. This closes [#41176](https://github.com/ClickHouse/ClickHouse/issues/41176) This closes [#42162](https://github.com/ClickHouse/ClickHouse/issues/42162). [#46141](https://github.com/ClickHouse/ClickHouse/pull/46141) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* More convenient usage of big integers and ORDER BY WITH FILL. Allow using plain integers for start and end points in WITH FILL when ORDER BY big (128-bit and 256-bit) integers. Fix the wrong result for big integers with negative start or end points. This closes [#16733](https://github.com/ClickHouse/ClickHouse/issues/16733). [#46152](https://github.com/ClickHouse/ClickHouse/pull/46152) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* Add `parts`, `active_parts` and `total_marks` columns to `system.tables` on [issue](https://github.com/ClickHouse/ClickHouse/issues/44336). [#46161](https://github.com/ClickHouse/ClickHouse/pull/46161) ([attack204](https://github.com/attack204)).
|
||||
* Functions "multi[Fuzzy]Match(Any|AnyIndex|AllIndices}" now reject regexes which will likely evaluate very slowly in vectorscan. [#46167](https://github.com/ClickHouse/ClickHouse/pull/46167) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* When `insert_null_as_default` is enabled and column doesn't have defined default value, the default of column type will be used. Also this PR fixes using default values on nulls in case of LowCardinality columns. [#46171](https://github.com/ClickHouse/ClickHouse/pull/46171) ([Kruglov Pavel](https://github.com/Avogar)).
|
||||
* Prefer explicitly defined access keys for S3 clients. If `use_environment_credentials` is set to `true`, and the user has provided the access key through query or config, they will be used instead of the ones from the environment variable. [#46191](https://github.com/ClickHouse/ClickHouse/pull/46191) ([Antonio Andelic](https://github.com/antonio2368)).
|
||||
* Add an alias "DATE_FORMAT()" for function "formatDateTime()" to improve compatibility with MySQL's SQL dialect, extend function `formatDateTime` with substitutions "a", "b", "c", "h", "i", "k", "l" "r", "s", "W". ### Documentation entry for user-facing changes User-readable short description: `DATE_FORMAT` is an alias of `formatDateTime`. Formats a Time according to the given Format string. Format is a constant expression, so you cannot have multiple formats for a single result column. (Provide link to [formatDateTime](https://clickhouse.com/docs/en/sql-reference/functions/date-time-functions/#formatdatetime)). [#46302](https://github.com/ClickHouse/ClickHouse/pull/46302) ([Jake Bamrah](https://github.com/JakeBamrah)).
|
||||
* Add `ProfileEvents` and `CurrentMetrics` about the callback tasks for parallel replicas (`s3Cluster` and `MergeTree` tables). [#46313](https://github.com/ClickHouse/ClickHouse/pull/46313) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* Add support for `DELETE` and `UPDATE` for tables using `KeeperMap` storage engine. [#46330](https://github.com/ClickHouse/ClickHouse/pull/46330) ([Antonio Andelic](https://github.com/antonio2368)).
|
||||
* Allow writing RENAME queries with query parameters. Resolves [#45778](https://github.com/ClickHouse/ClickHouse/issues/45778). [#46407](https://github.com/ClickHouse/ClickHouse/pull/46407) ([Nikolay Degterinsky](https://github.com/evillique)).
|
||||
* Fix parameterized SELECT queries with REPLACE transformer. Resolves [#33002](https://github.com/ClickHouse/ClickHouse/issues/33002). [#46420](https://github.com/ClickHouse/ClickHouse/pull/46420) ([Nikolay Degterinsky](https://github.com/evillique)).
|
||||
* Exclude the internal database used for temporary/external tables from the calculation of asynchronous metric "NumberOfDatabases". This makes the behavior consistent with system table "system.databases". [#46435](https://github.com/ClickHouse/ClickHouse/pull/46435) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Added `last_exception_time` column into distribution_queue table. [#46564](https://github.com/ClickHouse/ClickHouse/pull/46564) ([Aleksandr](https://github.com/AVMusorin)).
|
||||
* Support for IN clause with parameter in parameterized views. [#46583](https://github.com/ClickHouse/ClickHouse/pull/46583) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
|
||||
* Do not load named collections on server startup (load them on first access instead). [#46607](https://github.com/ClickHouse/ClickHouse/pull/46607) ([Kseniia Sumarokova](https://github.com/kssenii)).
|
||||
|
||||
|
||||
#### Build/Testing/Packaging Improvement
|
||||
* Introduce GWP-ASan implemented by the LLVM runtime. This closes [#27039](https://github.com/ClickHouse/ClickHouse/issues/27039). [#45226](https://github.com/ClickHouse/ClickHouse/pull/45226) ([Han Fei](https://github.com/hanfei1991)).
|
||||
* We want to make our tests less stable and more flaky: add randomization for merge tree settings in tests. [#38983](https://github.com/ClickHouse/ClickHouse/pull/38983) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Enable the HDFS support in PowerPC and which helps to fixes the following functional tests 02113_hdfs_assert.sh, 02244_hdfs_cluster.sql and 02368_cancel_write_into_hdfs.sh. [#44949](https://github.com/ClickHouse/ClickHouse/pull/44949) ([MeenaRenganathan22](https://github.com/MeenaRenganathan22)).
|
||||
* Add systemd.service file for clickhouse-keeper. Fixes [#44293](https://github.com/ClickHouse/ClickHouse/issues/44293). [#45568](https://github.com/ClickHouse/ClickHouse/pull/45568) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
|
||||
* ClickHouse's fork of poco was moved from "contrib/" to "base/poco/". [#46075](https://github.com/ClickHouse/ClickHouse/pull/46075) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Add an option for `clickhouse-watchdog` to restart the child process. This does not make a lot of use. [#46312](https://github.com/ClickHouse/ClickHouse/pull/46312) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* If the environment variable `CLICKHOUSE_DOCKER_RESTART_ON_EXIT` is set to 1, the Docker container will run `clickhouse-server` as a child instead of the first process, and restart it when it exited. [#46391](https://github.com/ClickHouse/ClickHouse/pull/46391) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fix Systemd service file. [#46461](https://github.com/ClickHouse/ClickHouse/pull/46461) ([SuperDJY](https://github.com/cmsxbc)).
|
||||
* Raised the minimum Clang version needed to build ClickHouse from 12 to 15. [#46710](https://github.com/ClickHouse/ClickHouse/pull/46710) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Upgrade Intel QPL from v0.3.0 to v1.0.0 2. Build libaccel-config and link it statically to QPL library instead of dynamically. [#45809](https://github.com/ClickHouse/ClickHouse/pull/45809) ([jasperzhu](https://github.com/jinjunzh)).
|
||||
|
||||
|
||||
#### Bug Fix (user-visible misbehavior in official stable or prestable release)
|
||||
|
||||
* Flush data exactly by `rabbitmq_flush_interval_ms` or by `rabbitmq_max_block_size` in `StorageRabbitMQ`. Closes [#42389](https://github.com/ClickHouse/ClickHouse/issues/42389). Closes [#45160](https://github.com/ClickHouse/ClickHouse/issues/45160). [#44404](https://github.com/ClickHouse/ClickHouse/pull/44404) ([Kseniia Sumarokova](https://github.com/kssenii)).
|
||||
* Use PODArray to render in sparkBar function, so we can control the memory usage. Close [#44467](https://github.com/ClickHouse/ClickHouse/issues/44467). [#44489](https://github.com/ClickHouse/ClickHouse/pull/44489) ([Duc Canh Le](https://github.com/canhld94)).
|
||||
* Fix functions (quantilesExactExclusive, quantilesExactInclusive) return unsorted array element. [#45379](https://github.com/ClickHouse/ClickHouse/pull/45379) ([wujunfu](https://github.com/wujunfu)).
|
||||
* Fix uncaught exception in HTTPHandler when open telemetry is enabled. [#45456](https://github.com/ClickHouse/ClickHouse/pull/45456) ([Frank Chen](https://github.com/FrankChen021)).
|
||||
* Don't infer Dates from 8 digit numbers. It could lead to wrong data to be read. [#45581](https://github.com/ClickHouse/ClickHouse/pull/45581) ([Kruglov Pavel](https://github.com/Avogar)).
|
||||
* Fixes to correctly use `odbc_bridge_use_connection_pooling` setting. [#45591](https://github.com/ClickHouse/ClickHouse/pull/45591) ([Bharat Nallan](https://github.com/bharatnc)).
|
||||
* When the callback in the cache is called, it is possible that this cache is destructed. To keep it safe, we capture members by value. It's also safe for task schedule because it will be deactivated before storage is destroyed. Resolve [#45548](https://github.com/ClickHouse/ClickHouse/issues/45548). [#45601](https://github.com/ClickHouse/ClickHouse/pull/45601) ([Han Fei](https://github.com/hanfei1991)).
|
||||
* Fix data corruption when codecs Delta or DoubleDelta are combined with codec Gorilla. [#45615](https://github.com/ClickHouse/ClickHouse/pull/45615) ([Robert Schulze](https://github.com/rschu1ze)).
|
||||
* Correctly check types when using N-gram bloom filter index to avoid invalid reads. [#45617](https://github.com/ClickHouse/ClickHouse/pull/45617) ([Antonio Andelic](https://github.com/antonio2368)).
|
||||
* A couple of segfaults have been reported around `c-ares`. They were introduced in my previous pull requests. I have fixed them with the help of Alexander Tokmakov. [#45629](https://github.com/ClickHouse/ClickHouse/pull/45629) ([Arthur Passos](https://github.com/arthurpassos)).
|
||||
* Fix key description when encountering duplicate primary keys. This can happen in projections. See [#45590](https://github.com/ClickHouse/ClickHouse/issues/45590) for details. [#45686](https://github.com/ClickHouse/ClickHouse/pull/45686) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Set compression method and level for backup Closes [#45690](https://github.com/ClickHouse/ClickHouse/issues/45690). [#45737](https://github.com/ClickHouse/ClickHouse/pull/45737) ([Pradeep Chhetri](https://github.com/chhetripradeep)).
|
||||
* Should use `select_query_typed.limitByOffset()` instead of `select_query_typed.limitOffset()`. [#45817](https://github.com/ClickHouse/ClickHouse/pull/45817) ([刘陶峰](https://github.com/taofengliu)).
|
||||
* When use experimental analyzer, queries like `SELECT number FROM numbers(100) LIMIT 10 OFFSET 10;` get wrong results (empty result for this sql). That is caused by an unnecessary offset step added by planner. [#45822](https://github.com/ClickHouse/ClickHouse/pull/45822) ([刘陶峰](https://github.com/taofengliu)).
|
||||
* Backward compatibility - allow implicit narrowing conversion from UInt64 to IPv4 - required for "INSERT ... VALUES ..." expression. [#45865](https://github.com/ClickHouse/ClickHouse/pull/45865) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
|
||||
* Bugfix IPv6 parser for mixed ip4 address with missed first octet (like `::.1.2.3`). [#45871](https://github.com/ClickHouse/ClickHouse/pull/45871) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
|
||||
* Add the `query_kind` column to the `system.processes` table and the `SHOW PROCESSLIST` query. Remove duplicate code. It fixes a bug: the global configuration parameter `max_concurrent_select_queries` was not respected to queries with `INTERSECT` or `EXCEPT` chains. [#45872](https://github.com/ClickHouse/ClickHouse/pull/45872) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* Fix crash in a function `stochasticLinearRegression`. Found by WingFuzz. [#45985](https://github.com/ClickHouse/ClickHouse/pull/45985) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
|
||||
* Fix crash in `SELECT` queries with `INTERSECT` and `EXCEPT` modifiers that read data from tables with enabled sparse columns (controlled by setting `ratio_of_defaults_for_sparse_serialization`). [#45987](https://github.com/ClickHouse/ClickHouse/pull/45987) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Fix read in order optimization for DESC sorting with FINAL, close [#45815](https://github.com/ClickHouse/ClickHouse/issues/45815). [#46009](https://github.com/ClickHouse/ClickHouse/pull/46009) ([Vladimir C](https://github.com/vdimir)).
|
||||
* Fix reading of non existing nested columns with multiple level in compact parts. [#46045](https://github.com/ClickHouse/ClickHouse/pull/46045) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Fix elapsed column in system.processes (10x error). [#46047](https://github.com/ClickHouse/ClickHouse/pull/46047) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Follow-up fix for Replace domain IP types (IPv4, IPv6) with native https://github.com/ClickHouse/ClickHouse/pull/43221. [#46087](https://github.com/ClickHouse/ClickHouse/pull/46087) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
|
||||
* Fix environment variable substitution in the configuration when a parameter already has a value. This closes [#46131](https://github.com/ClickHouse/ClickHouse/issues/46131). This closes [#9547](https://github.com/ClickHouse/ClickHouse/issues/9547). [#46144](https://github.com/ClickHouse/ClickHouse/pull/46144) ([pufit](https://github.com/pufit)).
|
||||
* Fix incorrect predicate push down with grouping sets. Closes [#45947](https://github.com/ClickHouse/ClickHouse/issues/45947). [#46151](https://github.com/ClickHouse/ClickHouse/pull/46151) ([flynn](https://github.com/ucasfl)).
|
||||
* Fix possible pipeline stuck error on `fulls_sorting_join` with constant keys. [#46175](https://github.com/ClickHouse/ClickHouse/pull/46175) ([Vladimir C](https://github.com/vdimir)).
|
||||
* Never rewrite tuple functions as literals during formatting to avoid incorrect results. [#46232](https://github.com/ClickHouse/ClickHouse/pull/46232) ([Salvatore Mesoraca](https://github.com/aiven-sal)).
|
||||
* Fix possible out of bounds error while reading LowCardinality(Nullable) in Arrow format. [#46270](https://github.com/ClickHouse/ClickHouse/pull/46270) ([Kruglov Pavel](https://github.com/Avogar)).
|
||||
* Fix `SYSTEM UNFREEZE` queries failing with the exception `CANNOT_PARSE_INPUT_ASSERTION_FAILED`. [#46325](https://github.com/ClickHouse/ClickHouse/pull/46325) ([Aleksei Filatov](https://github.com/aalexfvk)).
|
||||
* Fix possible crash which can be caused by an integer overflow while deserializing aggregating state of a function that stores HashTable. [#46349](https://github.com/ClickHouse/ClickHouse/pull/46349) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
|
||||
* Fix possible `LOGICAL_ERROR` in asynchronous inserts with invalid data sent in format `VALUES`. [#46350](https://github.com/ClickHouse/ClickHouse/pull/46350) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Fixed a LOGICAL_ERROR on an attempt to execute `ALTER ... MOVE PART ... TO TABLE`. This type of query was never actually supported. [#46359](https://github.com/ClickHouse/ClickHouse/pull/46359) ([Alexander Tokmakov](https://github.com/tavplubix)).
|
||||
* Fix s3Cluster schema inference in parallel distributed insert select when `parallel_distributed_insert_select` is enabled. [#46381](https://github.com/ClickHouse/ClickHouse/pull/46381) ([Kruglov Pavel](https://github.com/Avogar)).
|
||||
* Fix queries like `ALTER TABLE ... UPDATE nested.arr1 = nested.arr2 ...`, where `arr1` and `arr2` are fields of the same `Nested` column. [#46387](https://github.com/ClickHouse/ClickHouse/pull/46387) ([Anton Popov](https://github.com/CurtizJ)).
|
||||
* Scheduler may fail to schedule a task. If it happens, the whole MulityPartUpload should be aborted and `UploadHelper` must wait for already scheduled tasks. [#46451](https://github.com/ClickHouse/ClickHouse/pull/46451) ([Dmitry Novik](https://github.com/novikd)).
|
||||
* Fix PREWHERE for Merge with different default types (fixes some `NOT_FOUND_COLUMN_IN_BLOCK` when the default type for the column differs, also allow `PREWHERE` when the type of column is the same across tables, and prohibit it, only if it differs). [#46454](https://github.com/ClickHouse/ClickHouse/pull/46454) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Fix a crash that could happen when constant values are used in `ORDER BY`. Fixes [#46466](https://github.com/ClickHouse/ClickHouse/issues/46466). [#46493](https://github.com/ClickHouse/ClickHouse/pull/46493) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
|
||||
* Do not throw exception if `disk` setting was specified on query level, but `storage_policy` was specified in config merge tree settings section. `disk` will override setting from config. [#46533](https://github.com/ClickHouse/ClickHouse/pull/46533) ([Kseniia Sumarokova](https://github.com/kssenii)).
|
||||
* Fix an invalid processing of constant `LowCardinality` argument in function `arrayMap`. This bug could lead to a segfault in release, and logical error `Bad cast` in debug build. [#46569](https://github.com/ClickHouse/ClickHouse/pull/46569) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
|
||||
* fixes [#46557](https://github.com/ClickHouse/ClickHouse/issues/46557). [#46611](https://github.com/ClickHouse/ClickHouse/pull/46611) ([Alexander Gololobov](https://github.com/davenger)).
|
||||
* Fix endless restarts of clickhouse-server systemd unit if server cannot start within 1m30sec (Disable timeout logic for starting clickhouse-server from systemd service). [#46613](https://github.com/ClickHouse/ClickHouse/pull/46613) ([Azat Khuzhin](https://github.com/azat)).
|
||||
* Allocated during asynchronous inserts memory buffers were deallocated in the global context and MemoryTracker counters for corresponding user and query were not updated correctly. That led to false positive OOM exceptions. [#46622](https://github.com/ClickHouse/ClickHouse/pull/46622) ([Dmitry Novik](https://github.com/novikd)).
|
||||
* Updated to not clear on_expression from table_join as its used by future analyze runs resolves [#45185](https://github.com/ClickHouse/ClickHouse/issues/45185). [#46487](https://github.com/ClickHouse/ClickHouse/pull/46487) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
|
||||
|
||||
|
||||
### <a id="231"></a> ClickHouse release 23.1, 2023-01-26
|
||||
|
||||
### ClickHouse release 23.1
|
||||
|
@ -458,7 +458,7 @@ endif ()
|
||||
set (CMAKE_POSTFIX_VARIABLE "CMAKE_${CMAKE_BUILD_TYPE_UC}_POSTFIX")
|
||||
|
||||
set (CMAKE_POSITION_INDEPENDENT_CODE OFF)
|
||||
if (OS_LINUX AND NOT ARCH_AARCH64)
|
||||
if (OS_LINUX AND NOT (ARCH_AARCH64 OR ARCH_S390X))
|
||||
# Slightly more efficient code can be generated
|
||||
# It's disabled for ARM because otherwise ClickHouse cannot run on Android.
|
||||
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-pie")
|
||||
|
@ -2,6 +2,11 @@
|
||||
|
||||
ClickHouse® is an open-source column-oriented database management system that allows generating analytical data reports in real-time.
|
||||
|
||||
## How To Install (Linux, macOS, FreeBSD)
|
||||
```
|
||||
curl https://clickhouse.com/ | sh
|
||||
```
|
||||
|
||||
## Useful Links
|
||||
|
||||
* [Official website](https://clickhouse.com/) has a quick high-level overview of ClickHouse on the main page.
|
||||
@ -9,14 +14,13 @@ ClickHouse® is an open-source column-oriented database management system that a
|
||||
* [Tutorial](https://clickhouse.com/docs/en/getting_started/tutorial/) shows how to set up and query a small ClickHouse cluster.
|
||||
* [Documentation](https://clickhouse.com/docs/en/) provides more in-depth information.
|
||||
* [YouTube channel](https://www.youtube.com/c/ClickHouseDB) has a lot of content about ClickHouse in video format.
|
||||
* [Slack](https://clickhousedb.slack.com/) and [Telegram](https://telegram.me/clickhouse_en) allow chatting with ClickHouse users in real-time.
|
||||
* [Slack](https://join.slack.com/t/clickhousedb/shared_invite/zt-1gh9ds7f4-PgDhJAaF8ad5RbWBAAjzFg) and [Telegram](https://telegram.me/clickhouse_en) allow chatting with ClickHouse users in real-time.
|
||||
* [Blog](https://clickhouse.com/blog/) contains various ClickHouse-related articles, as well as announcements and reports about events.
|
||||
* [Code Browser (Woboq)](https://clickhouse.com/codebrowser/ClickHouse/index.html) with syntax highlight and navigation.
|
||||
* [Code Browser (github.dev)](https://github.dev/ClickHouse/ClickHouse) with syntax highlight, powered by github.dev.
|
||||
* [Contacts](https://clickhouse.com/company/contact) can help to get your questions answered if there are any.
|
||||
|
||||
## Upcoming Events
|
||||
* [**ClickHouse Workshop**](https://clickhouse.com/company/events/2023-02-15-clickhouse-workshop?utm_source=github&utm_medium=social&utm_campaign=workshop) - Feb 15 & 16 - In this 2-day (3 hrs per day) free training, topics range from introductory content to a deep dive on interacting with and understanding your data. There will be both live training and hands-on labs.
|
||||
* [**v23.2 Release Webinar**](https://clickhouse.com/company/events/v23-2-release-webinar?utm_source=github&utm_medium=social&utm_campaign=release-webinar-2023-02) - Feb 23 - 23.2 is rapidly approaching. Original creator, co-founder, and CTO of ClickHouse Alexey Milovidov will walk us through the highlights of the release.
|
||||
* [**ClickHouse Meetup in Amsterdam**](https://www.meetup.com/clickhouse-netherlands-user-group/events/291485868/) - Mar 9 - The first ClickHouse Amsterdam Meetup of 2023 is here! 🎉 Join us for short lightning talks and long discussions. Food, drinks & good times on us.
|
||||
* [**ClickHouse Meetup in SF Bay Area**](https://www.meetup.com/clickhouse-silicon-valley-meetup-group/events/291490121/) - Mar 14 - A night to meet with ClickHouse team in the San Francisco area! Food and drink are a given...but networking is the primary focus.
|
||||
|
@ -13,9 +13,10 @@ The following versions of ClickHouse server are currently being supported with s
|
||||
|
||||
| Version | Supported |
|
||||
|:-|:-|
|
||||
| 23.2 | ✔️ |
|
||||
| 23.1 | ✔️ |
|
||||
| 22.12 | ✔️ |
|
||||
| 22.11 | ✔️ |
|
||||
| 22.11 | ❌ |
|
||||
| 22.10 | ❌ |
|
||||
| 22.9 | ❌ |
|
||||
| 22.8 | ✔️ |
|
||||
|
@ -12,21 +12,22 @@
|
||||
template <typename To, typename From>
|
||||
std::decay_t<To> bit_cast(const From & from)
|
||||
{
|
||||
/**
|
||||
* Assume the source value is 0xAABBCCDD (i.e. sizeof(from) == 4).
|
||||
* Its BE representation is 0xAABBCCDD, the LE representation is 0xDDCCBBAA.
|
||||
* Further assume, sizeof(res) == 8 and that res is initially zeroed out.
|
||||
* With LE, the result after bit_cast will be 0xDDCCBBAA00000000 --> input value == output value.
|
||||
* With BE, the result after bit_cast will be 0x00000000AABBCCDD --> input value == output value.
|
||||
*/
|
||||
/** Assume the source value is 0xAABBCCDD (i.e. sizeof(from) == 4).
|
||||
* Its BE representation is 0xAABBCCDD, the LE representation is 0xDDCCBBAA.
|
||||
* Further assume, sizeof(res) == 8 and that res is initially zeroed out.
|
||||
* With LE, the result after bit_cast will be 0xDDCCBBAA00000000 --> input value == output value.
|
||||
* With BE, the result after bit_cast will be 0x00000000AABBCCDD --> input value == output value.
|
||||
*/
|
||||
To res {};
|
||||
if constexpr (std::endian::native == std::endian::little)
|
||||
memcpy(static_cast<void*>(&res), &from, std::min(sizeof(res), sizeof(from)));
|
||||
{
|
||||
memcpy(static_cast<void*>(&res), &from, std::min(sizeof(res), sizeof(from)));
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t offset_to = (sizeof(res) > sizeof(from)) ? (sizeof(res) - sizeof(from)) : 0;
|
||||
uint32_t offset_from = (sizeof(from) > sizeof(res)) ? (sizeof(from) - sizeof(res)) : 0;
|
||||
memcpy(reinterpret_cast<char *>(&res) + offset_to, reinterpret_cast<const char *>(&from) + offset_from, std::min(sizeof(res), sizeof(from)));
|
||||
uint32_t offset_to = (sizeof(res) > sizeof(from)) ? (sizeof(res) - sizeof(from)) : 0;
|
||||
uint32_t offset_from = (sizeof(from) > sizeof(res)) ? (sizeof(from) - sizeof(res)) : 0;
|
||||
memcpy(reinterpret_cast<char *>(&res) + offset_to, reinterpret_cast<const char *>(&from) + offset_from, std::min(sizeof(res), sizeof(from)));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -13,11 +13,7 @@ using char8_t = unsigned char;
|
||||
#endif
|
||||
|
||||
/// This is needed for more strict aliasing. https://godbolt.org/z/xpJBSb https://stackoverflow.com/a/57453713
|
||||
#if !defined(PVS_STUDIO) /// But PVS-Studio does not treat it correctly.
|
||||
using UInt8 = char8_t;
|
||||
#else
|
||||
using UInt8 = uint8_t;
|
||||
#endif
|
||||
|
||||
using UInt16 = uint16_t;
|
||||
using UInt32 = uint32_t;
|
||||
|
@ -78,9 +78,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Disable warnings by PVS-Studio
|
||||
//-V::GA
|
||||
|
||||
static const double
|
||||
pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
|
||||
a0 = 7.72156649015328655494e-02, /* 0x3FB3C467, 0xE37DB0C8 */
|
||||
|
@ -85,9 +85,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// Disable warnings by PVS-Studio
|
||||
//-V::GA
|
||||
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include "libm.h"
|
||||
|
@ -155,7 +155,7 @@ static inline long double fp_barrierl(long double x)
|
||||
static inline void fp_force_evalf(float x)
|
||||
{
|
||||
volatile float y;
|
||||
y = x; //-V1001
|
||||
y = x;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -164,7 +164,7 @@ static inline void fp_force_evalf(float x)
|
||||
static inline void fp_force_eval(double x)
|
||||
{
|
||||
volatile double y;
|
||||
y = x; //-V1001
|
||||
y = x;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -173,7 +173,7 @@ static inline void fp_force_eval(double x)
|
||||
static inline void fp_force_evall(long double x)
|
||||
{
|
||||
volatile long double y;
|
||||
y = x; //-V1001
|
||||
y = x;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -3,9 +3,6 @@
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
// Disable warnings by PVS-Studio
|
||||
//-V::GA
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include "libm.h"
|
||||
|
@ -455,7 +455,7 @@ auto bounded_rand(RngType& rng, typename RngType::result_type upper_bound)
|
||||
typedef typename RngType::result_type rtype;
|
||||
rtype threshold = (RngType::max() - RngType::min() + rtype(1) - upper_bound)
|
||||
% upper_bound;
|
||||
for (;;) { //-V1044
|
||||
for (;;) {
|
||||
rtype r = rng() - RngType::min();
|
||||
if (r >= threshold)
|
||||
return r % upper_bound;
|
||||
|
@ -930,7 +930,7 @@ struct rxs_m_xs_mixin {
|
||||
constexpr bitcount_t shift = bits - xtypebits;
|
||||
constexpr bitcount_t mask = (1 << opbits) - 1;
|
||||
bitcount_t rshift =
|
||||
opbits ? bitcount_t(internal >> (bits - opbits)) & mask : 0; //-V547
|
||||
opbits ? bitcount_t(internal >> (bits - opbits)) & mask : 0;
|
||||
internal ^= internal >> (opbits + rshift);
|
||||
internal *= mcg_multiplier<itype>::multiplier();
|
||||
xtype result = internal >> shift;
|
||||
@ -952,7 +952,7 @@ struct rxs_m_xs_mixin {
|
||||
|
||||
internal *= mcg_unmultiplier<itype>::unmultiplier();
|
||||
|
||||
bitcount_t rshift = opbits ? (internal >> (bits - opbits)) & mask : 0; //-V547
|
||||
bitcount_t rshift = opbits ? (internal >> (bits - opbits)) & mask : 0;
|
||||
internal = unxorshift(internal, bits, opbits + rshift);
|
||||
|
||||
return internal;
|
||||
@ -977,7 +977,7 @@ struct rxs_m_mixin {
|
||||
: 2;
|
||||
constexpr bitcount_t shift = bits - xtypebits;
|
||||
constexpr bitcount_t mask = (1 << opbits) - 1;
|
||||
bitcount_t rshift = opbits ? (internal >> (bits - opbits)) & mask : 0; //-V547
|
||||
bitcount_t rshift = opbits ? (internal >> (bits - opbits)) & mask : 0;
|
||||
internal ^= internal >> (opbits + rshift);
|
||||
internal *= mcg_multiplier<itype>::multiplier();
|
||||
xtype result = internal >> shift;
|
||||
@ -1368,7 +1368,7 @@ void extended<table_pow2,advance_pow2,baseclass,extvalclass,kdd>::selfinit()
|
||||
// - any strange correlations would only be apparent if we
|
||||
// were to backstep the generator so that the base generator
|
||||
// was generating the same values again
|
||||
result_type xdiff = baseclass::operator()() - baseclass::operator()(); //-V501
|
||||
result_type xdiff = baseclass::operator()() - baseclass::operator()();
|
||||
for (size_t i = 0; i < table_size; ++i) {
|
||||
data_[i] = baseclass::operator()() ^ xdiff;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ if (ENABLE_SSL)
|
||||
-Wno-unreachable-code-return
|
||||
-Wno-unused-parameter
|
||||
-Wno-zero-as-null-pointer-constant
|
||||
-Wno-used-but-marked-unused
|
||||
)
|
||||
target_include_directories (_poco_crypto SYSTEM PUBLIC "include")
|
||||
target_link_libraries (_poco_crypto PUBLIC Poco::Foundation OpenSSL::SSL OpenSSL::Crypto)
|
||||
|
@ -66,15 +66,6 @@ enum RSAPaddingMode
|
||||
// Crypto_API functions as being imported from a DLL, whereas this DLL sees symbols
|
||||
// defined with this macro as being exported.
|
||||
//
|
||||
#if defined(_WIN32)
|
||||
# if defined(POCO_DLL)
|
||||
# if defined(Crypto_EXPORTS)
|
||||
# define Crypto_API __declspec(dllexport)
|
||||
# else
|
||||
# define Crypto_API __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(Crypto_API)
|
||||
@ -89,76 +80,6 @@ enum RSAPaddingMode
|
||||
//
|
||||
// Automatically link Crypto and OpenSSL libraries.
|
||||
//
|
||||
#if defined(_MSC_VER)
|
||||
# if !defined(POCO_NO_AUTOMATIC_LIBS)
|
||||
# if defined(POCO_INTERNAL_OPENSSL_MSVC_VER)
|
||||
# if defined(POCO_EXTERNAL_OPENSSL)
|
||||
# pragma message("External OpenSSL defined but internal headers used - possible mismatch!")
|
||||
# endif // POCO_EXTERNAL_OPENSSL
|
||||
# if !defined(_DEBUG)
|
||||
# define POCO_DEBUG_SUFFIX ""
|
||||
# if !defined(_DLL)
|
||||
# define POCO_STATIC_SUFFIX "mt"
|
||||
# else // _DLL
|
||||
# define POCO_STATIC_SUFFIX ""
|
||||
# endif
|
||||
# else // _DEBUG
|
||||
# define POCO_DEBUG_SUFFIX "d"
|
||||
# if !defined(_DLL)
|
||||
# define POCO_STATIC_SUFFIX "mt"
|
||||
# else // _DLL
|
||||
# define POCO_STATIC_SUFFIX ""
|
||||
# endif
|
||||
# endif
|
||||
# pragma comment(lib, "libcrypto" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib")
|
||||
# pragma comment(lib, "libssl" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib")
|
||||
# if !defined(_WIN64) && !defined(_DLL) && (POCO_INTERNAL_OPENSSL_MSVC_VER == 120) \
|
||||
&& (POCO_MSVC_VERSION < POCO_INTERNAL_OPENSSL_MSVC_VER)
|
||||
# pragma comment(lib, "libPreVS2013CRT" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib")
|
||||
# endif
|
||||
# if !defined(_DLL) && (POCO_MSVS_VERSION >= 2015)
|
||||
# pragma comment(lib, "legacy_stdio_definitions.lib")
|
||||
# pragma comment(lib, "legacy_stdio_wide_specifiers.lib")
|
||||
# endif
|
||||
# elif defined(POCO_EXTERNAL_OPENSSL)
|
||||
# if POCO_EXTERNAL_OPENSSL == POCO_EXTERNAL_OPENSSL_SLPRO
|
||||
# if defined(POCO_DLL)
|
||||
# if OPENSSL_VERSION_PREREQ(1, 1)
|
||||
# pragma comment(lib, "libcrypto.lib")
|
||||
# pragma comment(lib, "libssl.lib")
|
||||
# else
|
||||
# pragma comment(lib, "libeay32.lib")
|
||||
# pragma comment(lib, "ssleay32.lib")
|
||||
# endif
|
||||
# else
|
||||
# if OPENSSL_VERSION_PREREQ(1, 1)
|
||||
# if defined(_WIN64)
|
||||
# pragma comment(lib, "libcrypto64" POCO_LIB_SUFFIX)
|
||||
# pragma comment(lib, "libssl64" POCO_LIB_SUFFIX)
|
||||
# else
|
||||
# pragma comment(lib, "libcrypto32" POCO_LIB_SUFFIX)
|
||||
# pragma comment(lib, "libssl32" POCO_LIB_SUFFIX)
|
||||
# endif
|
||||
# else
|
||||
# pragma comment(lib, "libeay32" POCO_LIB_SUFFIX)
|
||||
# pragma comment(lib, "ssleay32" POCO_LIB_SUFFIX)
|
||||
# endif
|
||||
# endif
|
||||
# elif POCO_EXTERNAL_OPENSSL == POCO_EXTERNAL_OPENSSL_DEFAULT
|
||||
# if OPENSSL_VERSION_PREREQ(1, 1)
|
||||
# pragma comment(lib, "libcrypto.lib")
|
||||
# pragma comment(lib, "libssl.lib")
|
||||
# else
|
||||
# pragma comment(lib, "libeay32.lib")
|
||||
# pragma comment(lib, "ssleay32.lib")
|
||||
# endif
|
||||
# endif
|
||||
# endif // POCO_INTERNAL_OPENSSL_MSVC_VER
|
||||
# if !defined(Crypto_EXPORTS)
|
||||
# pragma comment(lib, "PocoCrypto" POCO_LIB_SUFFIX)
|
||||
# endif
|
||||
# endif // POCO_NO_AUTOMATIC_LIBS
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco
|
||||
|
@ -22,36 +22,12 @@
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0907000L
|
||||
#include <openssl/conf.h>
|
||||
#endif
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
#define POCO_STR_HELPER(x) #x
|
||||
#define POCO_STR(x) POCO_STR_HELPER(x)
|
||||
#if defined POCO_INTERNAL_OPENSSL_MSVC_VER
|
||||
#define POCO_INTERNAL_OPENSSL_BUILD \
|
||||
" (POCO internal build, MSVC version " \
|
||||
POCO_STR(POCO_INTERNAL_OPENSSL_MSVC_VER) ")"
|
||||
#else
|
||||
#define POCO_INTERNAL_OPENSSL_BUILD ""
|
||||
#endif
|
||||
#pragma message (OPENSSL_VERSION_TEXT POCO_INTERNAL_OPENSSL_BUILD)
|
||||
#endif
|
||||
|
||||
|
||||
using Poco::RandomInputStream;
|
||||
using Poco::Thread;
|
||||
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_DLL) && defined(POCO_INTERNAL_OPENSSL_MSVC_VER)
|
||||
|
||||
#if (POCO_MSVS_VERSION >= 2015)
|
||||
FILE _iob[] = { *stdin, *stdout, *stderr };
|
||||
extern "C" FILE * __cdecl __iob_func(void) { return _iob; }
|
||||
#endif // (POCO_MSVS_VERSION >= 2015)
|
||||
|
||||
#if (POCO_MSVS_VERSION < 2012)
|
||||
extern "C" __declspec(noreturn) void __cdecl __report_rangecheckfailure(void) { ::ExitProcess(1); }
|
||||
#endif // (POCO_MSVS_VERSION < 2012)
|
||||
|
||||
#endif // _MSC_VER && _MT && !POCO_EXTERNAL_OPENSSL && (POCO_MSVS_VERSION < 2013)
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -100,7 +76,6 @@ void OpenSSLInitializer::initialize()
|
||||
int nMutexes = CRYPTO_num_locks();
|
||||
_mutexes = new Poco::FastMutex[nMutexes];
|
||||
CRYPTO_set_locking_callback(&OpenSSLInitializer::lock);
|
||||
#ifndef POCO_OS_FAMILY_WINDOWS
|
||||
// Not needed on Windows (see SF #110: random unhandled exceptions when linking with ssl).
|
||||
// https://sourceforge.net/p/poco/bugs/110/
|
||||
//
|
||||
@ -109,7 +84,6 @@ void OpenSSLInitializer::initialize()
|
||||
// then a default implementation is used - on Windows and BeOS this uses the system's
|
||||
// default thread identifying APIs"
|
||||
CRYPTO_set_id_callback(&OpenSSLInitializer::id);
|
||||
#endif
|
||||
CRYPTO_set_dynlock_create_callback(&OpenSSLInitializer::dynlockCreate);
|
||||
CRYPTO_set_dynlock_lock_callback(&OpenSSLInitializer::dynlock);
|
||||
CRYPTO_set_dynlock_destroy_callback(&OpenSSLInitializer::dynlockDestroy);
|
||||
@ -124,9 +98,7 @@ void OpenSSLInitializer::uninitialize()
|
||||
EVP_cleanup();
|
||||
ERR_free_strings();
|
||||
CRYPTO_set_locking_callback(0);
|
||||
#ifndef POCO_OS_FAMILY_WINDOWS
|
||||
CRYPTO_set_id_callback(0);
|
||||
#endif
|
||||
delete [] _mutexes;
|
||||
|
||||
CONF_modules_free();
|
||||
|
@ -102,7 +102,7 @@ RSAKeyImpl::RSAKeyImpl(const std::string& publicKeyFile,
|
||||
{
|
||||
BIO* bio = BIO_new(BIO_s_file());
|
||||
if (!bio) throw Poco::IOException("Cannot create BIO for reading public key", publicKeyFile);
|
||||
int rc = BIO_read_filename(bio, publicKeyFile.c_str());
|
||||
int rc = BIO_read_filename(bio, const_cast<char *>(publicKeyFile.c_str()));
|
||||
if (rc)
|
||||
{
|
||||
RSA* pubKey = PEM_read_bio_RSAPublicKey(bio, &_pRSA, 0, 0);
|
||||
@ -132,7 +132,7 @@ RSAKeyImpl::RSAKeyImpl(const std::string& publicKeyFile,
|
||||
{
|
||||
BIO* bio = BIO_new(BIO_s_file());
|
||||
if (!bio) throw Poco::IOException("Cannot create BIO for reading private key", privateKeyFile);
|
||||
int rc = BIO_read_filename(bio, privateKeyFile.c_str());
|
||||
int rc = BIO_read_filename(bio, const_cast<char *>(privateKeyFile.c_str()));
|
||||
if (rc)
|
||||
{
|
||||
RSA* privKey = 0;
|
||||
|
@ -20,10 +20,6 @@
|
||||
#include "Poco/Format.h"
|
||||
#include <sstream>
|
||||
#include <openssl/pem.h>
|
||||
#ifdef _WIN32
|
||||
// fix for WIN32 header conflict
|
||||
#undef X509_NAME
|
||||
#endif
|
||||
#include <openssl/x509v3.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
@ -133,7 +129,7 @@ void X509Certificate::load(const std::string& path)
|
||||
|
||||
BIO *pBIO = BIO_new(BIO_s_file());
|
||||
if (!pBIO) throw Poco::IOException("Cannot create BIO for reading certificate file", path);
|
||||
if (!BIO_read_filename(pBIO, path.c_str()))
|
||||
if (!BIO_read_filename(pBIO, const_cast<char *>(path.c_str())))
|
||||
{
|
||||
BIO_free(pBIO);
|
||||
throw Poco::OpenFileException("Cannot open certificate file for reading", path);
|
||||
|
@ -31,9 +31,6 @@
|
||||
#include "Poco/Data/ODBC/TypeInfo.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#include "Poco/Exception.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqlext.h>
|
||||
|
||||
|
||||
|
@ -20,9 +20,6 @@
|
||||
|
||||
#include "Poco/Data/ODBC/EnvironmentHandle.h"
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqltypes.h>
|
||||
|
||||
|
||||
|
@ -22,9 +22,6 @@
|
||||
#include <vector>
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqlext.h>
|
||||
|
||||
|
||||
|
@ -19,9 +19,6 @@
|
||||
|
||||
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqltypes.h>
|
||||
|
||||
|
||||
|
@ -23,9 +23,6 @@
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#include "Poco/Format.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqlext.h>
|
||||
|
||||
|
||||
|
@ -34,9 +34,6 @@
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Nullable.h"
|
||||
#include "Poco/UTFString.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqltypes.h>
|
||||
|
||||
|
||||
|
@ -23,9 +23,6 @@
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#include "Poco/Data/ODBC/ODBCException.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqltypes.h>
|
||||
|
||||
|
||||
|
@ -21,9 +21,6 @@
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
@ -34,13 +31,6 @@
|
||||
// ODBC_API functions as being imported from a DLL, whereas this DLL sees symbols
|
||||
// defined with this macro as being exported.
|
||||
//
|
||||
#if defined(_WIN32) && defined(POCO_DLL)
|
||||
# if defined(ODBC_EXPORTS)
|
||||
# define ODBC_API __declspec(dllexport)
|
||||
# else
|
||||
# define ODBC_API __declspec(dllimport)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(ODBC_API)
|
||||
@ -58,11 +48,6 @@
|
||||
//
|
||||
// Automatically link Data library.
|
||||
//
|
||||
#if defined(_MSC_VER)
|
||||
# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(ODBC_EXPORTS)
|
||||
# pragma comment(lib, "PocoDataODBC" POCO_LIB_SUFFIX)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif // ODBC_ODBC_INCLUDED
|
||||
|
@ -23,9 +23,6 @@
|
||||
#include "Poco/Data/ODBC/Handle.h"
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#include "Poco/Data/ODBC/ODBCException.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqlext.h>
|
||||
|
||||
|
||||
|
@ -29,9 +29,6 @@
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Format.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqltypes.h>
|
||||
|
||||
|
||||
|
@ -20,9 +20,6 @@
|
||||
|
||||
#include "Poco/Data/ODBC/Handle.h"
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqlext.h>
|
||||
|
||||
|
||||
|
@ -31,9 +31,6 @@
|
||||
#include "Poco/DynamicAny.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Poco/UTFString.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqlext.h>
|
||||
|
||||
|
||||
|
@ -27,9 +27,6 @@
|
||||
#include "Poco/Data/ODBC/TypeInfo.h"
|
||||
#include "Poco/Mutex.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqltypes.h>
|
||||
|
||||
|
||||
|
@ -23,9 +23,6 @@
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#include "Poco/DynamicAny.h"
|
||||
#include "Poco/NamedTuple.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <sqlext.h>
|
||||
|
||||
|
||||
|
@ -22,9 +22,6 @@
|
||||
#include "Poco/Buffer.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/UnicodeConverter.h"
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#ifndef SQL_NOUNICODEMAP
|
||||
# define SQL_NOUNICODEMAP
|
||||
#endif
|
||||
@ -33,10 +30,7 @@
|
||||
#include <sqlucode.h>
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
|
||||
# define POCO_ODBC_UNICODE
|
||||
# define POCO_ODBC_UNICODE_WINDOWS
|
||||
#elif defined(POCO_OS_FAMILY_UNIX) && defined(UNICODE)
|
||||
#if defined(POCO_OS_FAMILY_UNIX) && defined(UNICODE)
|
||||
# define POCO_ODBC_UNICODE
|
||||
# ifdef POCO_UNIXODBC
|
||||
# define POCO_ODBC_UNICODE_UNIXODBC
|
||||
|
@ -500,18 +500,6 @@ void Binder::getColumnOrParameterSize(std::size_t pos, SQLINTEGER& size)
|
||||
{
|
||||
size = DEFAULT_PARAM_SIZE;
|
||||
//On Linux, PostgreSQL driver segfaults on SQLGetDescField, so this is disabled for now
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
SQLHDESC hIPD = 0;
|
||||
if (!Utility::isError(SQLGetStmtAttr(_rStmt, SQL_ATTR_IMP_PARAM_DESC, &hIPD, SQL_IS_POINTER, 0)))
|
||||
{
|
||||
SQLUINTEGER sz = 0;
|
||||
if (!Utility::isError(SQLGetDescField(hIPD, (SQLSMALLINT) pos + 1, SQL_DESC_LENGTH, &sz, SQL_IS_UINTEGER, 0)) &&
|
||||
sz > 0)
|
||||
{
|
||||
size = sz;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (colSize > 0 && paramSize > 0)
|
||||
|
@ -20,9 +20,6 @@
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
#pragma warning(disable:4312)// 'type cast' : conversion from 'std::size_t' to 'SQLPOINTER' of greater size
|
||||
#endif
|
||||
|
||||
|
||||
using Poco::DataFormatException;
|
||||
|
@ -31,13 +31,6 @@
|
||||
// Data_API functions as being imported from a DLL, whereas this DLL sees symbols
|
||||
// defined with this macro as being exported.
|
||||
//
|
||||
#if defined(_WIN32) && defined(POCO_DLL)
|
||||
# if defined(Data_EXPORTS)
|
||||
# define Data_API __declspec(dllexport)
|
||||
# else
|
||||
# define Data_API __declspec(dllimport)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(Data_API)
|
||||
@ -52,11 +45,6 @@
|
||||
//
|
||||
// Automatically link Data library.
|
||||
//
|
||||
#if defined(_MSC_VER)
|
||||
# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Data_EXPORTS)
|
||||
# pragma comment(lib, "PocoData" POCO_LIB_SUFFIX)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif // Data_Data_INCLUDED
|
||||
|
@ -135,9 +135,7 @@ struct AlignedCharArrayImpl;
|
||||
|
||||
|
||||
// MSVC requires special handling here.
|
||||
# ifndef _MSC_VER
|
||||
|
||||
# ifdef POCO_COMPILER_CLANG
|
||||
|
||||
# if __has_feature(cxx_alignas)
|
||||
# define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
|
||||
@ -149,17 +147,6 @@ struct AlignedCharArrayImpl;
|
||||
# define POCO_HAVE_ALIGNMENT
|
||||
# endif
|
||||
|
||||
# elif defined(__GNUC__) || defined(__IBM_ATTRIBUTES)
|
||||
|
||||
# define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
|
||||
template <> \
|
||||
struct AlignedCharArrayImpl<x> \
|
||||
{ \
|
||||
char aligned __attribute__((aligned(x))); \
|
||||
}
|
||||
# define POCO_HAVE_ALIGNMENT
|
||||
|
||||
# endif
|
||||
|
||||
# ifdef POCO_HAVE_ALIGNMENT
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1);
|
||||
@ -179,58 +166,6 @@ POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192);
|
||||
# undef POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
|
||||
# endif // POCO_HAVE_ALIGNMENT
|
||||
|
||||
# else // _MSC_VER
|
||||
|
||||
// We provide special variations of this template for the most common
|
||||
// alignments because __declspec(align(...)) doesn't actually work when it is
|
||||
// a member of a by-value function argument in MSVC, even if the alignment
|
||||
// request is something reasonably like 8-byte or 16-byte.
|
||||
template <>
|
||||
struct AlignedCharArrayImpl<1>
|
||||
{
|
||||
char aligned;
|
||||
};
|
||||
template <>
|
||||
struct AlignedCharArrayImpl<2>
|
||||
{
|
||||
short aligned;
|
||||
};
|
||||
template <>
|
||||
struct AlignedCharArrayImpl<4>
|
||||
{
|
||||
int aligned;
|
||||
};
|
||||
template <>
|
||||
struct AlignedCharArrayImpl<8>
|
||||
{
|
||||
double aligned;
|
||||
};
|
||||
|
||||
# define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
|
||||
template <> \
|
||||
struct AlignedCharArrayImpl<x> \
|
||||
{ \
|
||||
__declspec(align(x)) char aligned; \
|
||||
}
|
||||
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128);
|
||||
|
||||
# if (_MSC_VER > 1600) // MSVC 2010 complains on alignment larger than 128
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(512);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1024);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2048);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4096);
|
||||
POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192);
|
||||
# endif // _MSC_VER > 1600
|
||||
|
||||
// Any larger and MSVC complains.
|
||||
# undef POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
|
||||
|
||||
# define POCO_HAVE_ALIGNMENT
|
||||
# endif // _MSC_VER
|
||||
|
||||
// POCO_HAVE_ALIGNMENT will be defined on the pre-C++11 platforms/compilers where
|
||||
// it can be reliably determined and used. Uncomment the line below to explicitly
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
BinaryReader & operator>>(float & value);
|
||||
BinaryReader & operator>>(double & value);
|
||||
|
||||
#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
|
||||
#if !defined(POCO_LONG_IS_64_BIT)
|
||||
BinaryReader & operator>>(Int64 & value);
|
||||
BinaryReader & operator>>(UInt64 & value);
|
||||
#endif
|
||||
@ -106,12 +106,10 @@ public:
|
||||
/// See BinaryWriter::write7BitEncoded() for a description
|
||||
/// of the compression algorithm.
|
||||
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
void read7BitEncoded(UInt64 & value);
|
||||
/// Reads a 64-bit unsigned integer in compressed format.
|
||||
/// See BinaryWriter::write7BitEncoded() for a description
|
||||
/// of the compression algorithm.
|
||||
#endif
|
||||
|
||||
void readRaw(std::streamsize length, std::string & value);
|
||||
/// Reads length bytes of raw data into value.
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
BinaryWriter & operator<<(float value);
|
||||
BinaryWriter & operator<<(double value);
|
||||
|
||||
#if defined(POCO_HAVE_INT64) && !defined(POCO_LONG_IS_64_BIT)
|
||||
#if !defined(POCO_LONG_IS_64_BIT)
|
||||
BinaryWriter & operator<<(Int64 value);
|
||||
BinaryWriter & operator<<(UInt64 value);
|
||||
#endif
|
||||
@ -114,7 +114,6 @@ public:
|
||||
/// written out. value is then shifted by seven bits and the next byte is written.
|
||||
/// This process is repeated until the entire integer has been written.
|
||||
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
void write7BitEncoded(UInt64 value);
|
||||
/// Writes a 64-bit unsigned integer in a compressed format.
|
||||
/// The value written out seven bits at a time, starting
|
||||
@ -125,7 +124,6 @@ public:
|
||||
/// If value will not fit in seven bits, the high bit is set on the first byte and
|
||||
/// written out. value is then shifted by seven bits and the next byte is written.
|
||||
/// This process is repeated until the entire integer has been written.
|
||||
#endif
|
||||
|
||||
void writeRaw(const std::string & rawData);
|
||||
/// Writes the string as-is to the stream.
|
||||
|
@ -161,9 +161,6 @@ private:
|
||||
// instantiation - to avoid duplicate symbols due to multiple
|
||||
// instantiations in different libraries.
|
||||
//
|
||||
#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
|
||||
template class Foundation_API BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>>;
|
||||
#endif
|
||||
typedef BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>> BufferedBidirectionalStreamBuf;
|
||||
|
||||
|
||||
|
@ -151,9 +151,6 @@ private:
|
||||
// instantiation - to avoid duplicate symbols due to multiple
|
||||
// instantiations in different libraries.
|
||||
//
|
||||
#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
|
||||
template class Foundation_API BasicBufferedStreamBuf<char, std::char_traits<char>>;
|
||||
#endif
|
||||
typedef BasicBufferedStreamBuf<char, std::char_traits<char>> BufferedStreamBuf;
|
||||
|
||||
|
||||
|
@ -18,9 +18,6 @@
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Types.h"
|
||||
#if defined(_MSC_VER)
|
||||
# include <stdlib.h> // builtins
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco
|
||||
@ -37,77 +34,55 @@ public:
|
||||
static UInt16 flipBytes(UInt16 value);
|
||||
static Int32 flipBytes(Int32 value);
|
||||
static UInt32 flipBytes(UInt32 value);
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
static Int64 flipBytes(Int64 value);
|
||||
static UInt64 flipBytes(UInt64 value);
|
||||
#endif
|
||||
|
||||
static Int16 toBigEndian(Int16 value);
|
||||
static UInt16 toBigEndian(UInt16 value);
|
||||
static Int32 toBigEndian(Int32 value);
|
||||
static UInt32 toBigEndian(UInt32 value);
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
static Int64 toBigEndian(Int64 value);
|
||||
static UInt64 toBigEndian(UInt64 value);
|
||||
#endif
|
||||
|
||||
static Int16 fromBigEndian(Int16 value);
|
||||
static UInt16 fromBigEndian(UInt16 value);
|
||||
static Int32 fromBigEndian(Int32 value);
|
||||
static UInt32 fromBigEndian(UInt32 value);
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
static Int64 fromBigEndian(Int64 value);
|
||||
static UInt64 fromBigEndian(UInt64 value);
|
||||
#endif
|
||||
|
||||
static Int16 toLittleEndian(Int16 value);
|
||||
static UInt16 toLittleEndian(UInt16 value);
|
||||
static Int32 toLittleEndian(Int32 value);
|
||||
static UInt32 toLittleEndian(UInt32 value);
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
static Int64 toLittleEndian(Int64 value);
|
||||
static UInt64 toLittleEndian(UInt64 value);
|
||||
#endif
|
||||
|
||||
static Int16 fromLittleEndian(Int16 value);
|
||||
static UInt16 fromLittleEndian(UInt16 value);
|
||||
static Int32 fromLittleEndian(Int32 value);
|
||||
static UInt32 fromLittleEndian(UInt32 value);
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
static Int64 fromLittleEndian(Int64 value);
|
||||
static UInt64 fromLittleEndian(UInt64 value);
|
||||
#endif
|
||||
|
||||
static Int16 toNetwork(Int16 value);
|
||||
static UInt16 toNetwork(UInt16 value);
|
||||
static Int32 toNetwork(Int32 value);
|
||||
static UInt32 toNetwork(UInt32 value);
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
static Int64 toNetwork(Int64 value);
|
||||
static UInt64 toNetwork(UInt64 value);
|
||||
#endif
|
||||
|
||||
static Int16 fromNetwork(Int16 value);
|
||||
static UInt16 fromNetwork(UInt16 value);
|
||||
static Int32 fromNetwork(Int32 value);
|
||||
static UInt32 fromNetwork(UInt32 value);
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
static Int64 fromNetwork(Int64 value);
|
||||
static UInt64 fromNetwork(UInt64 value);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#if !defined(POCO_NO_BYTESWAP_BUILTINS)
|
||||
# if defined(_MSC_VER)
|
||||
# if (POCO_MSVC_VERSION > 71)
|
||||
# define POCO_HAVE_MSC_BYTESWAP 1
|
||||
# endif
|
||||
# elif defined(__clang__)
|
||||
# if __has_builtin(__builtin_bswap32)
|
||||
# define POCO_HAVE_GCC_BYTESWAP 1
|
||||
# endif
|
||||
# elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
# if __has_builtin(__builtin_bswap32)
|
||||
# define POCO_HAVE_GCC_BYTESWAP 1
|
||||
# endif
|
||||
#endif
|
||||
@ -150,7 +125,6 @@ inline Int32 ByteOrder::flipBytes(Int32 value)
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
inline UInt64 ByteOrder::flipBytes(UInt64 value)
|
||||
{
|
||||
# if defined(POCO_HAVE_MSC_BYTESWAP)
|
||||
@ -169,7 +143,6 @@ inline Int64 ByteOrder::flipBytes(Int64 value)
|
||||
{
|
||||
return Int64(flipBytes(UInt64(value)));
|
||||
}
|
||||
#endif // POCO_HAVE_INT64
|
||||
|
||||
|
||||
//
|
||||
@ -187,7 +160,6 @@ inline Int64 ByteOrder::flipBytes(Int64 value)
|
||||
}
|
||||
|
||||
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
# define POCO_IMPLEMENT_BYTEORDER_NOOP(op) \
|
||||
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int16) \
|
||||
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt16) \
|
||||
@ -202,18 +174,6 @@ inline Int64 ByteOrder::flipBytes(Int64 value)
|
||||
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt32) \
|
||||
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int64) \
|
||||
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt64)
|
||||
#else
|
||||
# define POCO_IMPLEMENT_BYTEORDER_NOOP(op) \
|
||||
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int16) \
|
||||
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt16) \
|
||||
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int32) \
|
||||
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt32)
|
||||
# define POCO_IMPLEMENT_BYTEORDER_FLIP(op) \
|
||||
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int16) \
|
||||
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt16) \
|
||||
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int32) \
|
||||
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt32)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(POCO_ARCH_BIG_ENDIAN)
|
||||
|
@ -23,11 +23,7 @@
|
||||
#include "Poco/Manifest.h"
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
# define POCO_LIBRARY_API __declspec(dllexport)
|
||||
#else
|
||||
# define POCO_LIBRARY_API
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
|
@ -159,9 +159,6 @@
|
||||
|
||||
|
||||
// Windows CE has no locale support
|
||||
#if defined(_WIN32_WCE)
|
||||
# define POCO_NO_LOCALE
|
||||
#endif
|
||||
|
||||
|
||||
// Enable the poco_debug_* and poco_trace_* macros
|
||||
|
@ -1,74 +0,0 @@
|
||||
//
|
||||
// DirectoryIterator_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: DirectoryIterator
|
||||
//
|
||||
// Definition of the DirectoryIteratorImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_DirectoryIterator_WIN32_INCLUDED
|
||||
#define Foundation_DirectoryIterator_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API DirectoryIteratorImpl
|
||||
{
|
||||
public:
|
||||
DirectoryIteratorImpl(const std::string & path);
|
||||
~DirectoryIteratorImpl();
|
||||
|
||||
void duplicate();
|
||||
void release();
|
||||
|
||||
const std::string & get() const;
|
||||
const std::string & next();
|
||||
|
||||
private:
|
||||
HANDLE _fh;
|
||||
WIN32_FIND_DATA _fd;
|
||||
std::string _current;
|
||||
int _rc;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
const std::string & DirectoryIteratorImpl::get() const
|
||||
{
|
||||
return _current;
|
||||
}
|
||||
|
||||
|
||||
inline void DirectoryIteratorImpl::duplicate()
|
||||
{
|
||||
++_rc;
|
||||
}
|
||||
|
||||
|
||||
inline void DirectoryIteratorImpl::release()
|
||||
{
|
||||
if (--_rc == 0)
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_DirectoryIterator_WIN32_INCLUDED
|
@ -1,74 +0,0 @@
|
||||
//
|
||||
// DirectoryIterator_WIN32U.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: DirectoryIterator
|
||||
//
|
||||
// Definition of the DirectoryIteratorImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_DirectoryIterator_WIN32U_INCLUDED
|
||||
#define Foundation_DirectoryIterator_WIN32U_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API DirectoryIteratorImpl
|
||||
{
|
||||
public:
|
||||
DirectoryIteratorImpl(const std::string & path);
|
||||
~DirectoryIteratorImpl();
|
||||
|
||||
void duplicate();
|
||||
void release();
|
||||
|
||||
const std::string & get() const;
|
||||
const std::string & next();
|
||||
|
||||
private:
|
||||
HANDLE _fh;
|
||||
WIN32_FIND_DATAW _fd;
|
||||
std::string _current;
|
||||
int _rc;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
const std::string & DirectoryIteratorImpl::get() const
|
||||
{
|
||||
return _current;
|
||||
}
|
||||
|
||||
|
||||
inline void DirectoryIteratorImpl::duplicate()
|
||||
{
|
||||
++_rc;
|
||||
}
|
||||
|
||||
|
||||
inline void DirectoryIteratorImpl::release()
|
||||
{
|
||||
if (--_rc == 0)
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_DirectoryIterator_WIN32U_INCLUDED
|
@ -1,57 +0,0 @@
|
||||
//
|
||||
// Environment_VX.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: Environment
|
||||
//
|
||||
// Definition of the EnvironmentImpl class for VxWorks.
|
||||
//
|
||||
// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Environment_VX_INCLUDED
|
||||
#define Foundation_Environment_VX_INCLUDED
|
||||
|
||||
|
||||
#include <map>
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Mutex.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API EnvironmentImpl
|
||||
{
|
||||
public:
|
||||
typedef UInt8 NodeId[6]; /// Ethernet address.
|
||||
|
||||
static std::string getImpl(const std::string & name);
|
||||
static bool hasImpl(const std::string & name);
|
||||
static void setImpl(const std::string & name, const std::string & value);
|
||||
static std::string osNameImpl();
|
||||
static std::string osDisplayNameImpl();
|
||||
static std::string osVersionImpl();
|
||||
static std::string osArchitectureImpl();
|
||||
static std::string nodeNameImpl();
|
||||
static void nodeIdImpl(NodeId & id);
|
||||
static unsigned processorCountImpl();
|
||||
|
||||
private:
|
||||
typedef std::map<std::string, std::string> StringMap;
|
||||
|
||||
static StringMap _map;
|
||||
static FastMutex _mutex;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Environment_VX_INCLUDED
|
@ -1,49 +0,0 @@
|
||||
//
|
||||
// Environment_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: Environment
|
||||
//
|
||||
// Definition of the EnvironmentImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Environment_WIN32_INCLUDED
|
||||
#define Foundation_Environment_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API EnvironmentImpl
|
||||
{
|
||||
public:
|
||||
typedef UInt8 NodeId[6]; /// Ethernet address.
|
||||
|
||||
static std::string getImpl(const std::string & name);
|
||||
static bool hasImpl(const std::string & name);
|
||||
static void setImpl(const std::string & name, const std::string & value);
|
||||
static std::string osNameImpl();
|
||||
static std::string osDisplayNameImpl();
|
||||
static std::string osVersionImpl();
|
||||
static std::string osArchitectureImpl();
|
||||
static std::string nodeNameImpl();
|
||||
static void nodeIdImpl(NodeId & id);
|
||||
static unsigned processorCountImpl();
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Environment_WIN32_INCLUDED
|
@ -1,49 +0,0 @@
|
||||
//
|
||||
// Environment_WIN32U.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: Environment
|
||||
//
|
||||
// Definition of the EnvironmentImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Environment_WIN32U_INCLUDED
|
||||
#define Foundation_Environment_WIN32U_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API EnvironmentImpl
|
||||
{
|
||||
public:
|
||||
typedef UInt8 NodeId[6]; /// Ethernet address.
|
||||
|
||||
static std::string getImpl(const std::string & name);
|
||||
static bool hasImpl(const std::string & name);
|
||||
static void setImpl(const std::string & name, const std::string & value);
|
||||
static std::string osNameImpl();
|
||||
static std::string osDisplayNameImpl();
|
||||
static std::string osVersionImpl();
|
||||
static std::string osArchitectureImpl();
|
||||
static std::string nodeNameImpl();
|
||||
static void nodeIdImpl(NodeId & id);
|
||||
static unsigned processorCountImpl();
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Environment_WIN32U_INCLUDED
|
@ -1,60 +0,0 @@
|
||||
//
|
||||
// Environment_WINCE.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: Environment
|
||||
//
|
||||
// Definition of the EnvironmentImpl class for WINCE.
|
||||
//
|
||||
// Copyright (c) 2009-2010, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Environment_WINCE_INCLUDED
|
||||
#define Foundation_Environment_WINCE_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API EnvironmentImpl
|
||||
{
|
||||
public:
|
||||
typedef UInt8 NodeId[6]; /// Ethernet address.
|
||||
|
||||
static std::string getImpl(const std::string & name);
|
||||
static bool hasImpl(const std::string & name);
|
||||
static void setImpl(const std::string & name, const std::string & value);
|
||||
static std::string osNameImpl();
|
||||
static std::string osDisplayNameImpl();
|
||||
static std::string osVersionImpl();
|
||||
static std::string osArchitectureImpl();
|
||||
static std::string nodeNameImpl();
|
||||
static void nodeIdImpl(NodeId & id);
|
||||
static unsigned processorCountImpl();
|
||||
|
||||
private:
|
||||
static bool envVar(const std::string & name, std::string * value);
|
||||
|
||||
static const std::string TEMP;
|
||||
static const std::string TMP;
|
||||
static const std::string HOMEPATH;
|
||||
static const std::string COMPUTERNAME;
|
||||
static const std::string OS;
|
||||
static const std::string NUMBER_OF_PROCESSORS;
|
||||
static const std::string PROCESSOR_ARCHITECTURE;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Environment_WINCE_INCLUDED
|
@ -30,19 +30,11 @@ class Foundation_API Error
|
||||
/// for error reporting.
|
||||
{
|
||||
public:
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
static DWORD last();
|
||||
/// Utility function returning the last error.
|
||||
|
||||
static std::string getMessage(DWORD errorCode);
|
||||
/// Utility function translating numeric error code to string.
|
||||
#else
|
||||
static int last();
|
||||
/// Utility function returning the last error.
|
||||
|
||||
static std::string getMessage(int errorCode);
|
||||
/// Utility function translating numeric error code to string.
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
@ -22,13 +22,7 @@
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# include "Poco/Event_WIN32.h"
|
||||
#elif defined(POCO_VXWORKS)
|
||||
# include "Poco/Event_VX.h"
|
||||
#else
|
||||
# include "Poco/Event_POSIX.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco
|
||||
|
@ -86,11 +86,7 @@ protected:
|
||||
static int getType(const Message & msg);
|
||||
static int getCategory(const Message & msg);
|
||||
void setUpRegistry() const;
|
||||
#if defined(POCO_WIN32_UTF8)
|
||||
static std::wstring findLibrary(const wchar_t * name);
|
||||
#else
|
||||
static std::string findLibrary(const char * name);
|
||||
#endif
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
|
@ -1,50 +0,0 @@
|
||||
//
|
||||
// Event_VX.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Threading
|
||||
// Module: Event
|
||||
//
|
||||
// Definition of the EventImpl class for VxWorks.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Event_VX_INCLUDED
|
||||
#define Foundation_Event_VX_INCLUDED
|
||||
|
||||
|
||||
#include <semLib.h>
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API EventImpl
|
||||
{
|
||||
protected:
|
||||
EventImpl(bool autoReset);
|
||||
~EventImpl();
|
||||
void setImpl();
|
||||
void waitImpl();
|
||||
bool waitImpl(long milliseconds);
|
||||
void resetImpl();
|
||||
|
||||
private:
|
||||
bool _auto;
|
||||
volatile bool _state;
|
||||
SEM_ID _sem;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Event_VX_INCLUDED
|
@ -1,69 +0,0 @@
|
||||
//
|
||||
// Event_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Threading
|
||||
// Module: Event
|
||||
//
|
||||
// Definition of the EventImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Event_WIN32_INCLUDED
|
||||
#define Foundation_Event_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API EventImpl
|
||||
{
|
||||
protected:
|
||||
EventImpl(bool autoReset);
|
||||
~EventImpl();
|
||||
void setImpl();
|
||||
void waitImpl();
|
||||
bool waitImpl(long milliseconds);
|
||||
void resetImpl();
|
||||
|
||||
private:
|
||||
HANDLE _event;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline void EventImpl::setImpl()
|
||||
{
|
||||
if (!SetEvent(_event))
|
||||
{
|
||||
throw SystemException("cannot signal event");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline void EventImpl::resetImpl()
|
||||
{
|
||||
if (!ResetEvent(_event))
|
||||
{
|
||||
throw SystemException("cannot reset event");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Event_WIN32_INCLUDED
|
@ -27,12 +27,8 @@
|
||||
# include "Poco/FPEnvironment_DEC.h"
|
||||
#elif defined(sun) || defined(__sun)
|
||||
# include "Poco/FPEnvironment_SUN.h"
|
||||
#elif defined(__QNX__)
|
||||
# include "Poco/FPEnvironment_QNX.h"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
# include "Poco/FPEnvironment_C99.h"
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# include "Poco/FPEnvironment_WIN32.h"
|
||||
#else
|
||||
# include "Poco/FPEnvironment_DUMMY.h"
|
||||
#endif
|
||||
|
@ -1,90 +0,0 @@
|
||||
//
|
||||
// FPEnvironment_DEC.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: FPEnvironment
|
||||
//
|
||||
// Definitions of class FPEnvironmentImpl for Tru64 and OpenVMS Alpha.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_FPEnvironment_DEC_INCLUDED
|
||||
#define Foundation_FPEnvironment_DEC_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#if defined(__VMS)
|
||||
# include <ieeedef.h>
|
||||
#else
|
||||
# include <machine/fpu.h>
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class FPEnvironmentImpl
|
||||
{
|
||||
protected:
|
||||
enum RoundingModeImpl
|
||||
{
|
||||
FP_ROUND_DOWNWARD_IMPL = 0,
|
||||
FP_ROUND_UPWARD_IMPL = 0,
|
||||
FP_ROUND_TONEAREST_IMPL = 0,
|
||||
FP_ROUND_TOWARDZERO_IMPL = 0
|
||||
};
|
||||
enum FlagImpl
|
||||
{
|
||||
#if defined(__VMS)
|
||||
FP_DIVIDE_BY_ZERO_IMPL = IEEE$M_STATUS_DZE,
|
||||
FP_INEXACT_IMPL = IEEE$M_STATUS_INE,
|
||||
FP_OVERFLOW_IMPL = IEEE$M_STATUS_OVF,
|
||||
FP_UNDERFLOW_IMPL = IEEE$M_STATUS_UNF,
|
||||
FP_INVALID_IMPL = IEEE$M_STATUS_INV
|
||||
#else
|
||||
FP_DIVIDE_BY_ZERO_IMPL = IEEE_STATUS_DZE,
|
||||
FP_INEXACT_IMPL = IEEE_STATUS_INE,
|
||||
FP_OVERFLOW_IMPL = IEEE_STATUS_OVF,
|
||||
FP_UNDERFLOW_IMPL = IEEE_STATUS_UNF,
|
||||
FP_INVALID_IMPL = IEEE_STATUS_INV
|
||||
#endif
|
||||
};
|
||||
FPEnvironmentImpl();
|
||||
FPEnvironmentImpl(const FPEnvironmentImpl & env);
|
||||
~FPEnvironmentImpl();
|
||||
FPEnvironmentImpl & operator=(const FPEnvironmentImpl & env);
|
||||
void keepCurrentImpl();
|
||||
static void clearFlagsImpl();
|
||||
static bool isFlagImpl(FlagImpl flag);
|
||||
static void setRoundingModeImpl(RoundingModeImpl mode);
|
||||
static RoundingModeImpl getRoundingModeImpl();
|
||||
static bool isInfiniteImpl(float value);
|
||||
static bool isInfiniteImpl(double value);
|
||||
static bool isInfiniteImpl(long double value);
|
||||
static bool isNaNImpl(float value);
|
||||
static bool isNaNImpl(double value);
|
||||
static bool isNaNImpl(long double value);
|
||||
static float copySignImpl(float target, float source);
|
||||
static double copySignImpl(double target, double source);
|
||||
static long double copySignImpl(long double target, long double source);
|
||||
|
||||
private:
|
||||
#if defined(__VMS)
|
||||
struct _ieee _env;
|
||||
#else
|
||||
unsigned long _env;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_FPEnvironment_DEC_INCLUDED
|
@ -1,134 +0,0 @@
|
||||
//
|
||||
// FPEnvironment_QNX.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: FPEnvironment
|
||||
//
|
||||
// Definitions of class FPEnvironmentImpl for QNX.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_FPEnvironment_QNX_INCLUDED
|
||||
#define Foundation_FPEnvironment_QNX_INCLUDED
|
||||
|
||||
|
||||
#include <cmath>
|
||||
#include <fenv.h>
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class FPEnvironmentImpl
|
||||
{
|
||||
protected:
|
||||
enum RoundingModeImpl
|
||||
{
|
||||
FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD,
|
||||
FP_ROUND_UPWARD_IMPL = FE_UPWARD,
|
||||
FP_ROUND_TONEAREST_IMPL = FE_TONEAREST,
|
||||
FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO
|
||||
};
|
||||
enum FlagImpl
|
||||
{
|
||||
FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO,
|
||||
FP_INEXACT_IMPL = FE_INEXACT,
|
||||
FP_OVERFLOW_IMPL = FE_OVERFLOW,
|
||||
FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
|
||||
FP_INVALID_IMPL = FE_INVALID
|
||||
};
|
||||
FPEnvironmentImpl();
|
||||
FPEnvironmentImpl(const FPEnvironmentImpl & env);
|
||||
~FPEnvironmentImpl();
|
||||
FPEnvironmentImpl & operator=(const FPEnvironmentImpl & env);
|
||||
void keepCurrentImpl();
|
||||
static void clearFlagsImpl();
|
||||
static bool isFlagImpl(FlagImpl flag);
|
||||
static void setRoundingModeImpl(RoundingModeImpl mode);
|
||||
static RoundingModeImpl getRoundingModeImpl();
|
||||
static bool isInfiniteImpl(float value);
|
||||
static bool isInfiniteImpl(double value);
|
||||
static bool isInfiniteImpl(long double value);
|
||||
static bool isNaNImpl(float value);
|
||||
static bool isNaNImpl(double value);
|
||||
static bool isNaNImpl(long double value);
|
||||
static float copySignImpl(float target, float source);
|
||||
static double copySignImpl(double target, double source);
|
||||
static long double copySignImpl(long double target, long double source);
|
||||
|
||||
private:
|
||||
fenv_t _env;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(float value)
|
||||
{
|
||||
using namespace std;
|
||||
return isinf(value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(double value)
|
||||
{
|
||||
using namespace std;
|
||||
return isinf(value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(long double value)
|
||||
{
|
||||
using namespace std;
|
||||
return isinf((double)value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isNaNImpl(float value)
|
||||
{
|
||||
using namespace std;
|
||||
return isnan(value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isNaNImpl(double value)
|
||||
{
|
||||
using namespace std;
|
||||
return isnan(value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isNaNImpl(long double value)
|
||||
{
|
||||
using namespace std;
|
||||
return isnan((double)value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline float FPEnvironmentImpl::copySignImpl(float target, float source)
|
||||
{
|
||||
using namespace std;
|
||||
return copysignf(target, source);
|
||||
}
|
||||
|
||||
|
||||
inline double FPEnvironmentImpl::copySignImpl(double target, double source)
|
||||
{
|
||||
using namespace std;
|
||||
return copysign(target, source);
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_FPEnvironment_QNX_INCLUDED
|
@ -1,75 +0,0 @@
|
||||
//
|
||||
// FPEnvironment_SUN.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: FPEnvironment
|
||||
//
|
||||
// Definitions of class FPEnvironmentImpl for Solaris.
|
||||
//
|
||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_FPEnvironment_SUN_INCLUDED
|
||||
#define Foundation_FPEnvironment_SUN_INCLUDED
|
||||
|
||||
|
||||
#include <ieeefp.h>
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class FPEnvironmentImpl
|
||||
{
|
||||
protected:
|
||||
enum RoundingModeImpl
|
||||
{
|
||||
FP_ROUND_DOWNWARD_IMPL = FP_RM,
|
||||
FP_ROUND_UPWARD_IMPL = FP_RP,
|
||||
FP_ROUND_TONEAREST_IMPL = FP_RN,
|
||||
FP_ROUND_TOWARDZERO_IMPL = FP_RZ
|
||||
};
|
||||
enum FlagImpl
|
||||
{
|
||||
FP_DIVIDE_BY_ZERO_IMPL = FP_X_DZ,
|
||||
FP_INEXACT_IMPL = FP_X_IMP,
|
||||
FP_OVERFLOW_IMPL = FP_X_OFL,
|
||||
FP_UNDERFLOW_IMPL = FP_X_UFL,
|
||||
FP_INVALID_IMPL = FP_X_INV
|
||||
};
|
||||
FPEnvironmentImpl();
|
||||
FPEnvironmentImpl(const FPEnvironmentImpl & env);
|
||||
~FPEnvironmentImpl();
|
||||
FPEnvironmentImpl & operator=(const FPEnvironmentImpl & env);
|
||||
void keepCurrentImpl();
|
||||
static void clearFlagsImpl();
|
||||
static bool isFlagImpl(FlagImpl flag);
|
||||
static void setRoundingModeImpl(RoundingModeImpl mode);
|
||||
static RoundingModeImpl getRoundingModeImpl();
|
||||
static bool isInfiniteImpl(float value);
|
||||
static bool isInfiniteImpl(double value);
|
||||
static bool isInfiniteImpl(long double value);
|
||||
static bool isNaNImpl(float value);
|
||||
static bool isNaNImpl(double value);
|
||||
static bool isNaNImpl(long double value);
|
||||
static float copySignImpl(float target, float source);
|
||||
static double copySignImpl(double target, double source);
|
||||
static long double copySignImpl(long double target, long double source);
|
||||
|
||||
private:
|
||||
fp_rnd _rnd;
|
||||
fp_except _exc;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_FPEnvironment_SUN_INCLUDED
|
@ -1,151 +0,0 @@
|
||||
//
|
||||
// FPEnvironment_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: FPEnvironment
|
||||
//
|
||||
// Definitions of class FPEnvironmentImpl for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_FPEnvironment_WIN32_INCLUDED
|
||||
#define Foundation_FPEnvironment_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
#ifndef _SW_INEXACT
|
||||
# define _SW_INEXACT 0x00000001 // inexact (precision)
|
||||
#endif
|
||||
#ifndef _SW_UNDERFLOW
|
||||
# define _SW_UNDERFLOW 0x00000002 // underflow
|
||||
#endif
|
||||
#ifndef _SW_OVERFLOW
|
||||
# define _SW_OVERFLOW 0x00000004 // overflow
|
||||
#endif
|
||||
#ifndef _SW_ZERODIVIDE
|
||||
# define _SW_ZERODIVIDE 0x00000008 // zero divide
|
||||
#endif
|
||||
#ifndef _SW_INVALID
|
||||
# define _SW_INVALID 0x00000010 // invalid
|
||||
#endif
|
||||
#ifndef _SW_DENORMAL
|
||||
# define _SW_DENORMAL 0x00080000 // denormal status bit
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API FPEnvironmentImpl
|
||||
{
|
||||
protected:
|
||||
enum RoundingModeImpl
|
||||
{
|
||||
FP_ROUND_DOWNWARD_IMPL = _RC_DOWN,
|
||||
FP_ROUND_UPWARD_IMPL = _RC_UP,
|
||||
FP_ROUND_TONEAREST_IMPL = _RC_NEAR,
|
||||
FP_ROUND_TOWARDZERO_IMPL = _RC_CHOP
|
||||
};
|
||||
enum FlagImpl
|
||||
{
|
||||
FP_DIVIDE_BY_ZERO_IMPL = _SW_ZERODIVIDE,
|
||||
FP_INEXACT_IMPL = _SW_INEXACT,
|
||||
FP_OVERFLOW_IMPL = _SW_OVERFLOW,
|
||||
FP_UNDERFLOW_IMPL = _SW_UNDERFLOW,
|
||||
FP_INVALID_IMPL = _SW_INVALID
|
||||
};
|
||||
FPEnvironmentImpl();
|
||||
FPEnvironmentImpl(const FPEnvironmentImpl & env);
|
||||
~FPEnvironmentImpl();
|
||||
FPEnvironmentImpl & operator=(const FPEnvironmentImpl & env);
|
||||
void keepCurrentImpl();
|
||||
static void clearFlagsImpl();
|
||||
static bool isFlagImpl(FlagImpl flag);
|
||||
static void setRoundingModeImpl(RoundingModeImpl mode);
|
||||
static RoundingModeImpl getRoundingModeImpl();
|
||||
static bool isInfiniteImpl(float value);
|
||||
static bool isInfiniteImpl(double value);
|
||||
static bool isInfiniteImpl(long double value);
|
||||
static bool isNaNImpl(float value);
|
||||
static bool isNaNImpl(double value);
|
||||
static bool isNaNImpl(long double value);
|
||||
static float copySignImpl(float target, float source);
|
||||
static double copySignImpl(double target, double source);
|
||||
static long double copySignImpl(long double target, long double source);
|
||||
|
||||
private:
|
||||
unsigned _env;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(float value)
|
||||
{
|
||||
return _finite(value) == 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(double value)
|
||||
{
|
||||
return _finite(value) == 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isInfiniteImpl(long double value)
|
||||
{
|
||||
return _finite(value) == 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isNaNImpl(float value)
|
||||
{
|
||||
return _isnan(value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isNaNImpl(double value)
|
||||
{
|
||||
return _isnan(value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline bool FPEnvironmentImpl::isNaNImpl(long double value)
|
||||
{
|
||||
return _isnan(value) != 0;
|
||||
}
|
||||
|
||||
|
||||
inline float FPEnvironmentImpl::copySignImpl(float target, float source)
|
||||
{
|
||||
return float(_copysign(target, source));
|
||||
}
|
||||
|
||||
|
||||
inline double FPEnvironmentImpl::copySignImpl(double target, double source)
|
||||
{
|
||||
return _copysign(target, source);
|
||||
}
|
||||
|
||||
|
||||
inline long double FPEnvironmentImpl::copySignImpl(long double target, long double source)
|
||||
{
|
||||
return (source > 0 && target > 0) || (source < 0 && target < 0) ? target : -target;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_FPEnvironment_WIN32_INCLUDED
|
@ -23,17 +23,7 @@
|
||||
#include "Poco/Timestamp.h"
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
|
||||
# if defined(_WIN32_WCE)
|
||||
# include "File_WINCE.h"
|
||||
# else
|
||||
# include "Poco/File_WIN32U.h"
|
||||
# endif
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# include "Poco/File_WIN32.h"
|
||||
#elif defined(POCO_VXWORKS)
|
||||
# include "Poco/File_VX.h"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
# include "Poco/File_UNIX.h"
|
||||
#endif
|
||||
|
||||
|
@ -19,11 +19,7 @@
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# include "Poco/FileStream_WIN32.h"
|
||||
#else
|
||||
# include "Poco/FileStream_POSIX.h"
|
||||
#endif
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
|
||||
|
@ -1,85 +0,0 @@
|
||||
//
|
||||
// File_VX.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: File
|
||||
//
|
||||
// Definition of the FileImpl class for VxWorks.
|
||||
//
|
||||
// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_File_VX_INCLUDED
|
||||
#define Foundation_File_VX_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class FileImpl
|
||||
{
|
||||
protected:
|
||||
typedef UInt64 FileSizeImpl;
|
||||
|
||||
FileImpl();
|
||||
FileImpl(const std::string & path);
|
||||
virtual ~FileImpl();
|
||||
void swapImpl(FileImpl & file);
|
||||
void setPathImpl(const std::string & path);
|
||||
const std::string & getPathImpl() const;
|
||||
bool existsImpl() const;
|
||||
bool canReadImpl() const;
|
||||
bool canWriteImpl() const;
|
||||
bool canExecuteImpl() const;
|
||||
bool isFileImpl() const;
|
||||
bool isDirectoryImpl() const;
|
||||
bool isLinkImpl() const;
|
||||
bool isDeviceImpl() const;
|
||||
bool isHiddenImpl() const;
|
||||
Timestamp createdImpl() const;
|
||||
Timestamp getLastModifiedImpl() const;
|
||||
void setLastModifiedImpl(const Timestamp & ts);
|
||||
FileSizeImpl getSizeImpl() const;
|
||||
void setSizeImpl(FileSizeImpl size);
|
||||
void setWriteableImpl(bool flag = true);
|
||||
void setExecutableImpl(bool flag = true);
|
||||
void copyToImpl(const std::string & path) const;
|
||||
void renameToImpl(const std::string & path);
|
||||
void linkToImpl(const std::string & path, int type) const;
|
||||
void removeImpl();
|
||||
bool createFileImpl();
|
||||
bool createDirectoryImpl();
|
||||
FileSizeImpl totalSpaceImpl() const;
|
||||
FileSizeImpl usableSpaceImpl() const;
|
||||
FileSizeImpl freeSpaceImpl() const;
|
||||
static void handleLastErrorImpl(const std::string & path);
|
||||
|
||||
private:
|
||||
std::string _path;
|
||||
|
||||
friend class DirectoryIteratorImpl;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline const std::string & FileImpl::getPathImpl() const
|
||||
{
|
||||
return _path;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_File_VX_INCLUDED
|
@ -1,88 +0,0 @@
|
||||
//
|
||||
// File_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: File
|
||||
//
|
||||
// Definition of the FileImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_File_WIN32_INCLUDED
|
||||
#define Foundation_File_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API FileImpl
|
||||
{
|
||||
protected:
|
||||
typedef UInt64 FileSizeImpl;
|
||||
|
||||
FileImpl();
|
||||
FileImpl(const std::string & path);
|
||||
virtual ~FileImpl();
|
||||
void swapImpl(FileImpl & file);
|
||||
void setPathImpl(const std::string & path);
|
||||
const std::string & getPathImpl() const;
|
||||
bool existsImpl() const;
|
||||
bool canReadImpl() const;
|
||||
bool canWriteImpl() const;
|
||||
bool canExecuteImpl() const;
|
||||
bool isFileImpl() const;
|
||||
bool isDirectoryImpl() const;
|
||||
bool isLinkImpl() const;
|
||||
bool isDeviceImpl() const;
|
||||
bool isHiddenImpl() const;
|
||||
Timestamp createdImpl() const;
|
||||
Timestamp getLastModifiedImpl() const;
|
||||
void setLastModifiedImpl(const Timestamp & ts);
|
||||
FileSizeImpl getSizeImpl() const;
|
||||
void setSizeImpl(FileSizeImpl size);
|
||||
void setWriteableImpl(bool flag = true);
|
||||
void setExecutableImpl(bool flag = true);
|
||||
void copyToImpl(const std::string & path) const;
|
||||
void renameToImpl(const std::string & path);
|
||||
void linkToImpl(const std::string & path, int type) const;
|
||||
void removeImpl();
|
||||
bool createFileImpl();
|
||||
bool createDirectoryImpl();
|
||||
FileSizeImpl totalSpaceImpl() const;
|
||||
FileSizeImpl usableSpaceImpl() const;
|
||||
FileSizeImpl freeSpaceImpl() const;
|
||||
static void handleLastErrorImpl(const std::string & path);
|
||||
|
||||
private:
|
||||
std::string _path;
|
||||
|
||||
friend class FileHandle;
|
||||
friend class DirectoryIteratorImpl;
|
||||
friend class WindowsDirectoryWatcherStrategy;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline const std::string & FileImpl::getPathImpl() const
|
||||
{
|
||||
return _path;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_File_WIN32_INCLUDED
|
@ -1,92 +0,0 @@
|
||||
//
|
||||
// File_WIN32U.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: File
|
||||
//
|
||||
// Definition of the Unicode FileImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_File_WIN32U_INCLUDED
|
||||
#define Foundation_File_WIN32U_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API FileImpl
|
||||
{
|
||||
protected:
|
||||
typedef UInt64 FileSizeImpl;
|
||||
|
||||
FileImpl();
|
||||
FileImpl(const std::string & path);
|
||||
virtual ~FileImpl();
|
||||
void swapImpl(FileImpl & file);
|
||||
void setPathImpl(const std::string & path);
|
||||
const std::string & getPathImpl() const;
|
||||
bool existsImpl() const;
|
||||
bool canReadImpl() const;
|
||||
bool canWriteImpl() const;
|
||||
bool canExecuteImpl() const;
|
||||
bool isFileImpl() const;
|
||||
bool isDirectoryImpl() const;
|
||||
bool isLinkImpl() const;
|
||||
bool isDeviceImpl() const;
|
||||
bool isHiddenImpl() const;
|
||||
Timestamp createdImpl() const;
|
||||
Timestamp getLastModifiedImpl() const;
|
||||
void setLastModifiedImpl(const Timestamp & ts);
|
||||
FileSizeImpl getSizeImpl() const;
|
||||
void setSizeImpl(FileSizeImpl size);
|
||||
void setWriteableImpl(bool flag = true);
|
||||
void setExecutableImpl(bool flag = true);
|
||||
void copyToImpl(const std::string & path) const;
|
||||
void renameToImpl(const std::string & path);
|
||||
void linkToImpl(const std::string & path, int type) const;
|
||||
void removeImpl();
|
||||
bool createFileImpl();
|
||||
bool createDirectoryImpl();
|
||||
FileSizeImpl totalSpaceImpl() const;
|
||||
FileSizeImpl usableSpaceImpl() const;
|
||||
FileSizeImpl freeSpaceImpl() const;
|
||||
static void handleLastErrorImpl(const std::string & path);
|
||||
static void convertPath(const std::string & utf8Path, std::wstring & utf16Path);
|
||||
|
||||
private:
|
||||
std::string _path;
|
||||
std::wstring _upath;
|
||||
|
||||
friend class FileHandle;
|
||||
friend class DirectoryIteratorImpl;
|
||||
friend class WindowsDirectoryWatcherStrategy;
|
||||
friend class FileStreamBuf;
|
||||
friend class LogFileImpl;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline const std::string & FileImpl::getPathImpl() const
|
||||
{
|
||||
return _path;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_File_WIN32U_INCLUDED
|
@ -1,91 +0,0 @@
|
||||
//
|
||||
// File_WIN32U.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: File
|
||||
//
|
||||
// Definition of the Unicode FileImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_File_WINCE_INCLUDED
|
||||
#define Foundation_File_WINCE_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API FileImpl
|
||||
{
|
||||
protected:
|
||||
typedef UInt64 FileSizeImpl;
|
||||
|
||||
FileImpl();
|
||||
FileImpl(const std::string & path);
|
||||
virtual ~FileImpl();
|
||||
void swapImpl(FileImpl & file);
|
||||
void setPathImpl(const std::string & path);
|
||||
const std::string & getPathImpl() const;
|
||||
bool existsImpl() const;
|
||||
bool canReadImpl() const;
|
||||
bool canWriteImpl() const;
|
||||
bool canExecuteImpl() const;
|
||||
bool isFileImpl() const;
|
||||
bool isDirectoryImpl() const;
|
||||
bool isLinkImpl() const;
|
||||
bool isDeviceImpl() const;
|
||||
bool isHiddenImpl() const;
|
||||
Timestamp createdImpl() const;
|
||||
Timestamp getLastModifiedImpl() const;
|
||||
void setLastModifiedImpl(const Timestamp & ts);
|
||||
FileSizeImpl getSizeImpl() const;
|
||||
void setSizeImpl(FileSizeImpl size);
|
||||
void setWriteableImpl(bool flag = true);
|
||||
void setExecutableImpl(bool flag = true);
|
||||
void copyToImpl(const std::string & path) const;
|
||||
void renameToImpl(const std::string & path);
|
||||
void linkToImpl(const std::string & path, int type) const;
|
||||
void removeImpl();
|
||||
bool createFileImpl();
|
||||
bool createDirectoryImpl();
|
||||
FileSizeImpl totalSpaceImpl() const;
|
||||
FileSizeImpl usableSpaceImpl() const;
|
||||
FileSizeImpl freeSpaceImpl() const;
|
||||
static void handleLastErrorImpl(const std::string & path);
|
||||
static void convertPath(const std::string & utf8Path, std::wstring & utf16Path);
|
||||
|
||||
private:
|
||||
std::string _path;
|
||||
std::wstring _upath;
|
||||
|
||||
friend class FileHandle;
|
||||
friend class DirectoryIteratorImpl;
|
||||
friend class FileStreamBuf;
|
||||
friend class LogFileImpl;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline const std::string & FileImpl::getPathImpl() const
|
||||
{
|
||||
return _path;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_File_WINCE_INCLUDED
|
@ -29,11 +29,6 @@
|
||||
//
|
||||
// Ensure that POCO_DLL is default unless POCO_STATIC is defined
|
||||
//
|
||||
#if defined(_WIN32) && defined(_DLL)
|
||||
# if !defined(POCO_DLL) && !defined(POCO_STATIC)
|
||||
# define POCO_DLL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
@ -44,13 +39,6 @@
|
||||
// Foundation_API functions as being imported from a DLL, whereas this DLL sees symbols
|
||||
// defined with this macro as being exported.
|
||||
//
|
||||
#if (defined(_WIN32) || defined(_WIN32_WCE)) && defined(POCO_DLL)
|
||||
# if defined(Foundation_EXPORTS)
|
||||
# define Foundation_API __declspec(dllexport)
|
||||
# else
|
||||
# define Foundation_API __declspec(dllimport)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(Foundation_API)
|
||||
@ -65,42 +53,13 @@
|
||||
//
|
||||
// Automatically link Foundation library.
|
||||
//
|
||||
#if defined(_MSC_VER)
|
||||
# if defined(POCO_DLL)
|
||||
# if defined(_DEBUG)
|
||||
# define POCO_LIB_SUFFIX "d.lib"
|
||||
# else
|
||||
# define POCO_LIB_SUFFIX ".lib"
|
||||
# endif
|
||||
# elif defined(_DLL)
|
||||
# if defined(_DEBUG)
|
||||
# define POCO_LIB_SUFFIX "mdd.lib"
|
||||
# else
|
||||
# define POCO_LIB_SUFFIX "md.lib"
|
||||
# endif
|
||||
# else
|
||||
# if defined(_DEBUG)
|
||||
# define POCO_LIB_SUFFIX "mtd.lib"
|
||||
# else
|
||||
# define POCO_LIB_SUFFIX "mt.lib"
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Foundation_EXPORTS)
|
||||
# pragma comment(lib, "PocoFoundation" POCO_LIB_SUFFIX)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Include platform-specific definitions
|
||||
//
|
||||
#include "Poco/Platform.h"
|
||||
#if defined(_WIN32)
|
||||
# include "Poco/Platform_WIN32.h"
|
||||
#elif defined(POCO_VXWORKS)
|
||||
# include "Poco/Platform_VX.h"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
# include "Poco/Platform_POSIX.h"
|
||||
#endif
|
||||
|
||||
@ -113,15 +72,6 @@
|
||||
//
|
||||
// Cleanup inconsistencies
|
||||
//
|
||||
#ifdef POCO_OS_FAMILY_WINDOWS
|
||||
# if defined(POCO_WIN32_UTF8) && defined(POCO_NO_WSTRING)
|
||||
# error POCO_WIN32_UTF8 and POCO_NO_WSTRING are mutually exclusive.
|
||||
# endif
|
||||
#else
|
||||
# ifdef POCO_WIN32_UTF8
|
||||
# undef POCO_WIN32_UTF8
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
@ -148,12 +98,8 @@
|
||||
# define POCO_DEPRECATED
|
||||
#elif defined(_GNUC_)
|
||||
# define POCO_DEPRECATED __attribute__((deprecated))
|
||||
#elif defined(__clang__)
|
||||
# define POCO_DEPRECATED __attribute__((deprecated))
|
||||
#elif defined(_MSC_VER)
|
||||
# define POCO_DEPRECATED __declspec(deprecated)
|
||||
#else
|
||||
# define POCO_DEPRECATED
|
||||
# define POCO_DEPRECATED __attribute__((deprecated))
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -113,7 +113,7 @@ public:
|
||||
}
|
||||
|
||||
std::size_t diff = curSize - _size;
|
||||
Iterator it = --_keys.end(); //--keys can never be invoked on an empty list due to the minSize==1 requirement of LRU
|
||||
Iterator it = --_keys.end(); /// --keys can never be invoked on an empty list due to the minSize==1 requirement of LRU
|
||||
std::size_t i = 0;
|
||||
|
||||
while (i++ < diff)
|
||||
|
@ -21,13 +21,7 @@
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
|
||||
# include "Poco/LogFile_WIN32U.h"
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# include "Poco/LogFile_WIN32.h"
|
||||
#else
|
||||
# include "Poco/LogFile_STD.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco
|
||||
|
@ -1,56 +0,0 @@
|
||||
//
|
||||
// LogFile_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Logging
|
||||
// Module: LogFile
|
||||
//
|
||||
// Definition of the LogFileImpl class using the Windows file APIs.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_LogFile_WIN32_INCLUDED
|
||||
#define Foundation_LogFile_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API LogFileImpl
|
||||
/// The implementation of LogFile for Windows.
|
||||
/// The native filesystem APIs are used for
|
||||
/// total control over locking behavior.
|
||||
{
|
||||
public:
|
||||
LogFileImpl(const std::string & path);
|
||||
~LogFileImpl();
|
||||
void writeImpl(const std::string & text, bool flush);
|
||||
void writeBinaryImpl(const char * data, size_t size, bool flush);
|
||||
UInt64 sizeImpl() const;
|
||||
Timestamp creationDateImpl() const;
|
||||
const std::string & pathImpl() const;
|
||||
|
||||
private:
|
||||
void createFile();
|
||||
|
||||
std::string _path;
|
||||
HANDLE _hFile;
|
||||
Timestamp _creationDate;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_LogFile_WIN32_INCLUDED
|
@ -1,56 +0,0 @@
|
||||
//
|
||||
// LogFile_WIN32U.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Logging
|
||||
// Module: LogFile
|
||||
//
|
||||
// Definition of the LogFileImpl class using the Windows file APIs.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_LogFile_WIN32U_INCLUDED
|
||||
#define Foundation_LogFile_WIN32U_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API LogFileImpl
|
||||
/// The implementation of LogFile for Windows.
|
||||
/// The native filesystem APIs are used for
|
||||
/// total control over locking behavior.
|
||||
{
|
||||
public:
|
||||
LogFileImpl(const std::string & path);
|
||||
~LogFileImpl();
|
||||
void writeImpl(const std::string & text, bool flush);
|
||||
void writeBinaryImpl(const char * data, size_t size, bool flush);
|
||||
UInt64 sizeImpl() const;
|
||||
Timestamp creationDateImpl() const;
|
||||
const std::string & pathImpl() const;
|
||||
|
||||
private:
|
||||
void createFile();
|
||||
|
||||
std::string _path;
|
||||
HANDLE _hFile;
|
||||
Timestamp _creationDate;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_LogFile_WIN32U_INCLUDED
|
@ -23,17 +23,7 @@
|
||||
#include "Poco/ScopedLock.h"
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# if defined(_WIN32_WCE)
|
||||
# include "Poco/Mutex_WINCE.h"
|
||||
# else
|
||||
# include "Poco/Mutex_WIN32.h"
|
||||
# endif
|
||||
#elif defined(POCO_VXWORKS)
|
||||
# include "Poco/Mutex_VX.h"
|
||||
#else
|
||||
# include "Poco/Mutex_POSIX.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace Poco
|
||||
|
@ -1,81 +0,0 @@
|
||||
//
|
||||
// Mutex_VX.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Threading
|
||||
// Module: Mutex
|
||||
//
|
||||
// Definition of the MutexImpl and FastMutexImpl classes for VxWorks.
|
||||
//
|
||||
// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Mutex_VX_INCLUDED
|
||||
#define Foundation_Mutex_VX_INCLUDED
|
||||
|
||||
|
||||
#include <errno.h>
|
||||
#include <semLib.h>
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API MutexImpl
|
||||
{
|
||||
protected:
|
||||
MutexImpl();
|
||||
MutexImpl(bool fast);
|
||||
~MutexImpl();
|
||||
void lockImpl();
|
||||
bool tryLockImpl();
|
||||
bool tryLockImpl(long milliseconds);
|
||||
void unlockImpl();
|
||||
|
||||
private:
|
||||
SEM_ID _sem;
|
||||
};
|
||||
|
||||
|
||||
class Foundation_API FastMutexImpl : public MutexImpl
|
||||
{
|
||||
protected:
|
||||
FastMutexImpl();
|
||||
~FastMutexImpl();
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline void MutexImpl::lockImpl()
|
||||
{
|
||||
if (semTake(_sem, WAIT_FOREVER) != OK)
|
||||
throw SystemException("cannot lock mutex");
|
||||
}
|
||||
|
||||
|
||||
inline bool MutexImpl::tryLockImpl()
|
||||
{
|
||||
return semTake(_sem, NO_WAIT) == OK;
|
||||
}
|
||||
|
||||
|
||||
inline void MutexImpl::unlockImpl()
|
||||
{
|
||||
if (semGive(_sem) != OK)
|
||||
throw SystemException("cannot unlock mutex");
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Mutex_VX_INCLUDED
|
@ -1,86 +0,0 @@
|
||||
//
|
||||
// Mutex_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Threading
|
||||
// Module: Mutex
|
||||
//
|
||||
// Definition of the MutexImpl and FastMutexImpl classes for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2008, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Mutex_WIN32_INCLUDED
|
||||
#define Foundation_Mutex_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API MutexImpl
|
||||
{
|
||||
protected:
|
||||
MutexImpl();
|
||||
~MutexImpl();
|
||||
void lockImpl();
|
||||
bool tryLockImpl();
|
||||
bool tryLockImpl(long milliseconds);
|
||||
void unlockImpl();
|
||||
|
||||
private:
|
||||
CRITICAL_SECTION _cs;
|
||||
};
|
||||
|
||||
|
||||
typedef MutexImpl FastMutexImpl;
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline void MutexImpl::lockImpl()
|
||||
{
|
||||
try
|
||||
{
|
||||
EnterCriticalSection(&_cs);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
throw SystemException("cannot lock mutex");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline bool MutexImpl::tryLockImpl()
|
||||
{
|
||||
try
|
||||
{
|
||||
return TryEnterCriticalSection(&_cs) != 0;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
throw SystemException("cannot lock mutex");
|
||||
}
|
||||
|
||||
|
||||
inline void MutexImpl::unlockImpl()
|
||||
{
|
||||
LeaveCriticalSection(&_cs);
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Mutex_WIN32_INCLUDED
|
@ -1,51 +0,0 @@
|
||||
//
|
||||
// Mutex_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Threading
|
||||
// Module: Mutex
|
||||
//
|
||||
// Definition of the MutexImpl and FastMutexImpl classes for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Mutex_WINCE_INCLUDED
|
||||
#define Foundation_Mutex_WINCE_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API MutexImpl
|
||||
{
|
||||
protected:
|
||||
MutexImpl();
|
||||
~MutexImpl();
|
||||
void lockImpl();
|
||||
bool tryLockImpl();
|
||||
bool tryLockImpl(long milliseconds);
|
||||
void unlockImpl();
|
||||
|
||||
private:
|
||||
HANDLE _mutex;
|
||||
};
|
||||
|
||||
|
||||
typedef MutexImpl FastMutexImpl;
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Mutex_WINCE_INCLUDED
|
@ -21,11 +21,7 @@
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
|
||||
# include "Poco/NamedEvent_WIN32U.h"
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# include "Poco/NamedEvent_WIN32.h"
|
||||
#elif POCO_OS == POCO_OS_ANDROID
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
# include "Poco/NamedEvent_Android.h"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
# include "Poco/NamedEvent_UNIX.h"
|
||||
|
@ -1,46 +0,0 @@
|
||||
//
|
||||
// NamedEvent_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Processes
|
||||
// Module: NamedEvent
|
||||
//
|
||||
// Definition of the NamedEventImpl class for Windows.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_NamedEvent_WIN32_INCLUDED
|
||||
#define Foundation_NamedEvent_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API NamedEventImpl
|
||||
{
|
||||
protected:
|
||||
NamedEventImpl(const std::string & name);
|
||||
~NamedEventImpl();
|
||||
void setImpl();
|
||||
void waitImpl();
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
HANDLE _event;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_NamedEvent_WIN32_INCLUDED
|
@ -1,47 +0,0 @@
|
||||
//
|
||||
// NamedEvent_WIN32U.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Processes
|
||||
// Module: NamedEvent
|
||||
//
|
||||
// Definition of the NamedEventImpl class for Windows.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_NamedEvent_WIN32U_INCLUDED
|
||||
#define Foundation_NamedEvent_WIN32U_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API NamedEventImpl
|
||||
{
|
||||
protected:
|
||||
NamedEventImpl(const std::string & name);
|
||||
~NamedEventImpl();
|
||||
void setImpl();
|
||||
void waitImpl();
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
std::wstring _uname;
|
||||
HANDLE _event;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_NamedEvent_WIN32U_INCLUDED
|
@ -22,11 +22,7 @@
|
||||
#include "Poco/ScopedLock.h"
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8)
|
||||
# include "Poco/NamedMutex_WIN32U.h"
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# include "Poco/NamedMutex_WIN32.h"
|
||||
#elif POCO_OS == POCO_OS_ANDROID
|
||||
#if POCO_OS == POCO_OS_ANDROID
|
||||
# include "Poco/NamedMutex_Android.h"
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
# include "Poco/NamedMutex_UNIX.h"
|
||||
|
@ -1,47 +0,0 @@
|
||||
//
|
||||
// NamedMutex_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Processes
|
||||
// Module: NamedMutex
|
||||
//
|
||||
// Definition of the NamedMutexImpl class for Windows.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_NamedMutex_WIN32_INCLUDED
|
||||
#define Foundation_NamedMutex_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API NamedMutexImpl
|
||||
{
|
||||
protected:
|
||||
NamedMutexImpl(const std::string & name);
|
||||
~NamedMutexImpl();
|
||||
void lockImpl();
|
||||
bool tryLockImpl();
|
||||
void unlockImpl();
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
HANDLE _mutex;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_NamedMutex_WIN32_INCLUDED
|
@ -1,48 +0,0 @@
|
||||
//
|
||||
// NamedMutex_WIN32U.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Processes
|
||||
// Module: NamedMutex
|
||||
//
|
||||
// Definition of the NamedMutexImpl class for Windows.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_NamedMutex_WIN32U_INCLUDED
|
||||
#define Foundation_NamedMutex_WIN32U_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API NamedMutexImpl
|
||||
{
|
||||
protected:
|
||||
NamedMutexImpl(const std::string & name);
|
||||
~NamedMutexImpl();
|
||||
void lockImpl();
|
||||
bool tryLockImpl();
|
||||
void unlockImpl();
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
std::wstring _uname;
|
||||
HANDLE _mutex;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_NamedMutex_WIN32U_INCLUDED
|
@ -151,7 +151,6 @@ public:
|
||||
/// If prefix is true, "0x" prefix is prepended to the
|
||||
/// resulting string.
|
||||
|
||||
#ifdef POCO_HAVE_INT64
|
||||
|
||||
# ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
@ -255,7 +254,6 @@ public:
|
||||
|
||||
# endif // ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
#endif // ifdef POCO_HAVE_INT64
|
||||
|
||||
static std::string format(float value);
|
||||
/// Formats a float value in decimal floating-point notation,
|
||||
@ -380,7 +378,6 @@ public:
|
||||
/// right justified and zero-padded in a field having at least the
|
||||
/// specified width.
|
||||
|
||||
#ifdef POCO_HAVE_INT64
|
||||
|
||||
# ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
@ -472,7 +469,6 @@ public:
|
||||
|
||||
# endif // ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
#endif // ifdef POCO_HAVE_INT64
|
||||
|
||||
static void append(std::string & str, float value);
|
||||
/// Formats a float value in decimal floating-point notation,
|
||||
@ -673,7 +669,6 @@ inline std::string NumberFormatter::formatHex(unsigned long value, int width, bo
|
||||
}
|
||||
|
||||
|
||||
#ifdef POCO_HAVE_INT64
|
||||
|
||||
# ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
@ -843,7 +838,6 @@ inline std::string NumberFormatter::formatHex(UInt64 value, int width, bool pref
|
||||
|
||||
# endif // ifdef POCO_LONG_IS_64_BIT
|
||||
|
||||
#endif // ifdef POCO_HAVE_INT64
|
||||
|
||||
|
||||
inline std::string NumberFormatter::format(float value)
|
||||
|
@ -80,7 +80,6 @@ public:
|
||||
/// Returns true if a valid integer has been found, false otherwise.
|
||||
/// If parsing was not successful, value is undefined.
|
||||
|
||||
#if defined(POCO_HAVE_INT64)
|
||||
|
||||
static Int64 parse64(const std::string & s, char thousandSeparator = ',');
|
||||
/// Parses a 64-bit integer value in decimal notation from the given string.
|
||||
@ -118,7 +117,6 @@ public:
|
||||
/// Returns true if a valid integer has been found, false otherwise.
|
||||
/// If parsing was not successful, value is undefined.
|
||||
|
||||
#endif // defined(POCO_HAVE_INT64)
|
||||
|
||||
static double parseFloat(const std::string & s, char decimalSeparator = '.', char thousandSeparator = ',');
|
||||
/// Parses a double value in decimal floating point notation
|
||||
|
@ -470,8 +470,6 @@ inline char Path::separator()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_VMS)
|
||||
return '.';
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
return '\\';
|
||||
#else
|
||||
return '/';
|
||||
#endif
|
||||
@ -482,8 +480,6 @@ inline char Path::pathSeparator()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_VMS)
|
||||
return ',';
|
||||
#elif defined(POCO_OS_FAMILY_WINDOWS)
|
||||
return ';';
|
||||
#else
|
||||
return ':';
|
||||
#endif
|
||||
|
@ -1,50 +0,0 @@
|
||||
//
|
||||
// Path_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: Path
|
||||
//
|
||||
// Definition of the PathImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Path_WIN32_INCLUDED
|
||||
#define Foundation_Path_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API PathImpl
|
||||
{
|
||||
public:
|
||||
static std::string currentImpl();
|
||||
static std::string homeImpl();
|
||||
static std::string configHomeImpl();
|
||||
static std::string dataHomeImpl();
|
||||
static std::string cacheHomeImpl();
|
||||
static std::string tempHomeImpl();
|
||||
static std::string tempImpl();
|
||||
static std::string configImpl();
|
||||
static std::string nullImpl();
|
||||
static std::string systemImpl();
|
||||
static std::string expandImpl(const std::string & path);
|
||||
static void listRootsImpl(std::vector<std::string> & roots);
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Path_WIN32_INCLUDED
|
@ -1,55 +0,0 @@
|
||||
//
|
||||
// Path_WIN32U.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: Path
|
||||
//
|
||||
// Definition of the PathImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Path_WIN32U_INCLUDED
|
||||
#define Foundation_Path_WIN32U_INCLUDED
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API PathImpl
|
||||
{
|
||||
public:
|
||||
static std::string currentImpl();
|
||||
static std::string homeImpl();
|
||||
static std::string configHomeImpl();
|
||||
static std::string dataHomeImpl();
|
||||
static std::string cacheHomeImpl();
|
||||
static std::string tempHomeImpl();
|
||||
static std::string tempImpl();
|
||||
static std::string configImpl();
|
||||
static std::string nullImpl();
|
||||
static std::string systemImpl();
|
||||
static std::string expandImpl(const std::string & path);
|
||||
static void listRootsImpl(std::vector<std::string> & roots);
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_PATH_LEN = 32767
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Path_WIN32U_INCLUDED
|
@ -1,55 +0,0 @@
|
||||
//
|
||||
// Path_WINCE.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
// Module: Path
|
||||
//
|
||||
// Definition of the PathImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Path_WINCE_INCLUDED
|
||||
#define Foundation_Path_WINCE_INCLUDED
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API PathImpl
|
||||
{
|
||||
public:
|
||||
static std::string currentImpl();
|
||||
static std::string homeImpl();
|
||||
static std::string configHomeImpl();
|
||||
static std::string dataHomeImpl();
|
||||
static std::string cacheHomeImpl();
|
||||
static std::string tempHomeImpl();
|
||||
static std::string tempImpl();
|
||||
static std::string configImpl();
|
||||
static std::string nullImpl();
|
||||
static std::string systemImpl();
|
||||
static std::string expandImpl(const std::string & path);
|
||||
static void listRootsImpl(std::vector<std::string> & roots);
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_PATH_LEN = 32767
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_Path_WINCE_INCLUDED
|
@ -21,13 +21,7 @@
|
||||
#include "Poco/Foundation.h"
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# if defined(_WIN32_WCE)
|
||||
# include "PipeImpl_DUMMY.h"
|
||||
# else
|
||||
# include "Poco/PipeImpl_WIN32.h"
|
||||
# endif
|
||||
#elif defined(POCO_OS_FAMILY_UNIX)
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
# include "Poco/PipeImpl_POSIX.h"
|
||||
#else
|
||||
# include "Poco/PipeImpl_DUMMY.h"
|
||||
|
@ -1,55 +0,0 @@
|
||||
//
|
||||
// PipeImpl_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Processes
|
||||
// Module: PipeImpl
|
||||
//
|
||||
// Definition of the PipeImpl class for WIN32.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_PipeImpl_WIN32_INCLUDED
|
||||
#define Foundation_PipeImpl_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/RefCountedObject.h"
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
namespace Poco
|
||||
{
|
||||
|
||||
|
||||
class Foundation_API PipeImpl : public RefCountedObject
|
||||
/// A dummy implementation of PipeImpl for platforms
|
||||
/// that do not support pipes.
|
||||
{
|
||||
public:
|
||||
typedef HANDLE Handle;
|
||||
|
||||
PipeImpl();
|
||||
~PipeImpl();
|
||||
int writeBytes(const void * buffer, int length);
|
||||
int readBytes(void * buffer, int length);
|
||||
Handle readHandle() const;
|
||||
Handle writeHandle() const;
|
||||
void closeRead();
|
||||
void closeWrite();
|
||||
|
||||
private:
|
||||
HANDLE _readHandle;
|
||||
HANDLE _writeHandle;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
||||
|
||||
#endif // Foundation_PipeImpl_WIN32_INCLUDED
|
@ -86,27 +86,12 @@
|
||||
#elif defined(sun) || defined(__sun)
|
||||
# define POCO_OS_FAMILY_UNIX 1
|
||||
# define POCO_OS POCO_OS_SOLARIS
|
||||
#elif defined(__QNX__)
|
||||
# define POCO_OS_FAMILY_UNIX 1
|
||||
# define POCO_OS POCO_OS_QNX
|
||||
#elif defined(__CYGWIN__)
|
||||
# define POCO_OS_FAMILY_UNIX 1
|
||||
# define POCO_OS POCO_OS_CYGWIN
|
||||
#elif defined(POCO_VXWORKS)
|
||||
# define POCO_OS_FAMILY_UNIX 1
|
||||
# define POCO_OS POCO_OS_VXWORKS
|
||||
#elif defined(unix) || defined(__unix) || defined(__unix__)
|
||||
# define POCO_OS_FAMILY_UNIX 1
|
||||
# define POCO_OS POCO_OS_UNKNOWN_UNIX
|
||||
#elif defined(_WIN32_WCE)
|
||||
# define POCO_OS_FAMILY_WINDOWS 1
|
||||
# define POCO_OS POCO_OS_WINDOWS_CE
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
# define POCO_OS_FAMILY_WINDOWS 1
|
||||
# define POCO_OS POCO_OS_WINDOWS_NT
|
||||
#elif defined(__VMS)
|
||||
# define POCO_OS_FAMILY_VMS 1
|
||||
# define POCO_OS POCO_OS_VMS
|
||||
#endif
|
||||
|
||||
|
||||
@ -155,10 +140,7 @@
|
||||
# define POCO_ARCH_LITTLE_ENDIAN 1
|
||||
#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(_M_MRX000)
|
||||
# define POCO_ARCH POCO_ARCH_MIPS
|
||||
# if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
// Is this OK? Supports windows only little endian??
|
||||
# define POCO_ARCH_LITTLE_ENDIAN 1
|
||||
# elif defined(__MIPSEB__) || defined(_MIPSEB) || defined(__MIPSEB)
|
||||
# if defined(__MIPSEB__) || defined(_MIPSEB) || defined(__MIPSEB)
|
||||
# define POCO_ARCH_BIG_ENDIAN 1
|
||||
# elif defined(__MIPSEL__) || defined(_MIPSEL) || defined(__MIPSEL)
|
||||
# define POCO_ARCH_LITTLE_ENDIAN 1
|
||||
@ -230,37 +212,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__clang__)
|
||||
# define POCO_COMPILER_CLANG
|
||||
#elif defined(_MSC_VER)
|
||||
# define POCO_COMPILER_MSVC
|
||||
#elif defined(__GNUC__)
|
||||
# define POCO_COMPILER_GCC
|
||||
#elif defined(__MINGW32__) || defined(__MINGW64__)
|
||||
# define POCO_COMPILER_MINGW
|
||||
#elif defined(__INTEL_COMPILER) || defined(__ICC) || defined(__ECC) || defined(__ICL)
|
||||
# define POCO_COMPILER_INTEL
|
||||
#elif defined(__SUNPRO_CC)
|
||||
# define POCO_COMPILER_SUN
|
||||
#elif defined(__MWERKS__) || defined(__CWCC__)
|
||||
# define POCO_COMPILER_CODEWARRIOR
|
||||
#elif defined(__sgi) || defined(sgi)
|
||||
# define POCO_COMPILER_SGI
|
||||
#elif defined(__HP_aCC)
|
||||
# define POCO_COMPILER_HP_ACC
|
||||
#elif defined(__BORLANDC__) || defined(__CODEGEARC__)
|
||||
# define POCO_COMPILER_CBUILDER
|
||||
#elif defined(__DMC__)
|
||||
# define POCO_COMPILER_DMARS
|
||||
#elif defined(__DECCXX)
|
||||
# define POCO_COMPILER_COMPAC
|
||||
#elif (defined(__xlc__) || defined(__xlC__)) && defined(__IBMCPP__)
|
||||
# define POCO_COMPILER_IBM_XLC // IBM XL C++
|
||||
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
|
||||
# define POCO_COMPILER_IBM_XLC_ZOS // IBM z/OS C++
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define POCO_UNUSED __attribute__((unused))
|
||||
#else
|
||||
@ -273,11 +224,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
# define POCO_DEFAULT_NEWLINE_CHARS "\r\n"
|
||||
#else
|
||||
# define POCO_DEFAULT_NEWLINE_CHARS "\n"
|
||||
#endif
|
||||
|
||||
|
||||
#endif // Foundation_Platform_INCLUDED
|
||||
|
@ -25,9 +25,6 @@
|
||||
#if defined(hpux) || defined(_hpux)
|
||||
# if defined(__hppa) || defined(__hppa__)
|
||||
# define POCO_NO_SYS_SELECT_H 1
|
||||
# if defined(__HP_aCC)
|
||||
# define POCO_NO_TEMPLATE_ICOMPARE 1
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -35,10 +32,8 @@
|
||||
//
|
||||
// Thread-safety of local static initialization
|
||||
//
|
||||
#if __cplusplus >= 201103L || __GNUC__ >= 4 || defined(__clang__)
|
||||
# ifndef POCO_LOCAL_STATIC_INIT_IS_THREADSAFE
|
||||
# define POCO_LOCAL_STATIC_INIT_IS_THREADSAFE 1
|
||||
# endif
|
||||
#ifndef POCO_LOCAL_STATIC_INIT_IS_THREADSAFE
|
||||
# define POCO_LOCAL_STATIC_INIT_IS_THREADSAFE 1
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
//
|
||||
// Platform_VX.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: Platform
|
||||
//
|
||||
// Platform and architecture identification macros
|
||||
// and platform-specific definitions for VxWorks
|
||||
//
|
||||
// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Platform_VX_INCLUDED
|
||||
#define Foundation_Platform_VX_INCLUDED
|
||||
|
||||
|
||||
#define POCO_NO_SYS_SELECT_H
|
||||
#define POCO_NO_FPENVIRONMENT
|
||||
#define POCO_NO_WSTRING
|
||||
#define POCO_NO_SHAREDMEMORY
|
||||
#define POCO_NO_SYSLOGCHANNEL
|
||||
|
||||
|
||||
#endif // Foundation_Platform_VX_INCLUDED
|
@ -1,217 +0,0 @@
|
||||
//
|
||||
// Platform_WIN32.h
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
// Module: Platform
|
||||
//
|
||||
// Platform and architecture identification macros
|
||||
// and platform-specific definitions for Windows.
|
||||
//
|
||||
// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
//
|
||||
|
||||
|
||||
#ifndef Foundation_Platform_WIN32_INCLUDED
|
||||
#define Foundation_Platform_WIN32_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/UnWindows.h"
|
||||
|
||||
|
||||
#ifndef POCO_FORCE_MIN_WINDOWS_OS_SUPPORT
|
||||
// Determine the real version.
|
||||
// This setting can be forced from UnWindows.h
|
||||
# if defined(_WIN32_WINNT_WINBLUE)
|
||||
//Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_WINBLUE
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION NTDDI_WINBLUE
|
||||
# elif defined(_WIN32_WINNT_WIN8)
|
||||
//Windows 8 _WIN32_WINNT_WIN8 (0x0602)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_WIN8
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION NTDDI_WIN8
|
||||
# elif defined(_WIN32_WINNT_WIN7)
|
||||
//Windows 7 _WIN32_WINNT_WIN7 (0x0601)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_WIN7
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION NTDDI_WIN7
|
||||
# elif defined(_WIN32_WINNT_WS08)
|
||||
//Windows Server 2008 _WIN32_WINNT_WS08 (0x0600)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_WS08
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION NTDDI_WS08
|
||||
# elif defined(_WIN32_WINNT_VISTA)
|
||||
//Windows Vista _WIN32_WINNT_VISTA (0x0600)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_VISTA
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION NTDDI_VISTA
|
||||
# elif defined(_WIN32_WINNT_LONGHORN)
|
||||
//Windows Vista and server 2008 Development _WIN32_WINNT_LONGHORN (0x0600)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_LONGHORN
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION 0x06000000 // hardcoded, VS90 can't find NTDDI_* macros
|
||||
# elif defined(_WIN32_WINNT_WS03)
|
||||
//Windows Server 2003 with SP1,
|
||||
//Windows XP with SP2 _WIN32_WINNT_WS03 (0x0502)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_WS03
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION NTDDI_WS03
|
||||
# elif defined(_WIN32_WINNT_WINXP)
|
||||
//Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_WINXP
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION NTDDI_WINXP
|
||||
# elif defined(_WIN32_WINNT_WIN2K)
|
||||
//Windows 2000 _WIN32_WINNT_WIN2K (0x0500)
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT _WIN32_WINNT_WIN2K
|
||||
# elif defined(WINVER)
|
||||
// fail back on WINVER
|
||||
# ifdef _WIN32_WINNT
|
||||
# undef _WIN32_WINNT
|
||||
# endif
|
||||
# define _WIN32_WINNT WINVER
|
||||
# elif !defined(_WIN32_WINNT)
|
||||
// last resort = Win XP, SP2 is minimum supported
|
||||
# define _WIN32_WINNT 0x0502
|
||||
# ifdef NTDDI_VERSION
|
||||
# undef NTDDI_VERSION
|
||||
# endif
|
||||
# define NTDDI_VERSION 0x05020000
|
||||
# endif
|
||||
#endif // POCO_FORCE_MIN_WINDOWS_OS_SUPPORT
|
||||
|
||||
|
||||
#if defined(_MSC_VER) && !defined(POCO_MSVC_SECURE_WARNINGS) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
# define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
|
||||
// Verify that we're built with the multithreaded
|
||||
// versions of the runtime libraries
|
||||
#if defined(_MSC_VER) && !defined(_MT)
|
||||
# error Must compile with /MD, /MDd, /MT or /MTd
|
||||
#endif
|
||||
|
||||
|
||||
// Check debug/release settings consistency
|
||||
#if defined(NDEBUG) && defined(_DEBUG)
|
||||
# error Inconsistent build settings (check for /MD[d])
|
||||
#endif
|
||||
|
||||
|
||||
#if (_MSC_VER >= 1300) && (_MSC_VER < 1400) // Visual Studio 2003, MSVC++ 7.1
|
||||
# define POCO_MSVS_VERSION 2003
|
||||
# define POCO_MSVC_VERSION 71
|
||||
#elif (_MSC_VER >= 1400) && (_MSC_VER < 1500) // Visual Studio 2005, MSVC++ 8.0
|
||||
# define POCO_MSVS_VERSION 2005
|
||||
# define POCO_MSVC_VERSION 80
|
||||
#elif (_MSC_VER >= 1500) && (_MSC_VER < 1600) // Visual Studio 2008, MSVC++ 9.0
|
||||
# define POCO_MSVS_VERSION 2008
|
||||
# define POCO_MSVC_VERSION 90
|
||||
#elif (_MSC_VER >= 1600) && (_MSC_VER < 1700) // Visual Studio 2010, MSVC++ 10.0
|
||||
# define POCO_MSVS_VERSION 2010
|
||||
# define POCO_MSVC_VERSION 100
|
||||
#elif (_MSC_VER >= 1700) && (_MSC_VER < 1800) // Visual Studio 2012, MSVC++ 11.0
|
||||
# define POCO_MSVS_VERSION 2012
|
||||
# define POCO_MSVC_VERSION 110
|
||||
#elif (_MSC_VER >= 1800) && (_MSC_VER < 1900) // Visual Studio 2013, MSVC++ 12.0
|
||||
# define POCO_MSVS_VERSION 2013
|
||||
# define POCO_MSVC_VERSION 120
|
||||
#elif (_MSC_VER >= 1900) && (_MSC_VER < 1910) // Visual Studio 2015, MSVC++ 14.0
|
||||
# define POCO_MSVS_VERSION 2015
|
||||
# define POCO_MSVC_VERSION 140
|
||||
#elif (_MSC_VER >= 1910) && (_MSC_VER < 2000) // Visual Studio 2017, MSVC++ 14.1
|
||||
# define POCO_MSVS_VERSION 2017
|
||||
# define POCO_MSVC_VERSION 141
|
||||
#endif
|
||||
|
||||
|
||||
// Unicode Support
|
||||
#if defined(UNICODE) && !defined(POCO_WIN32_UTF8)
|
||||
# define POCO_WIN32_UTF8
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(POCO_WIN32_UTF8)
|
||||
# pragma message("Compiling POCO on Windows without #define POCO_WIN32_UTF8 is deprecated.")
|
||||
#endif
|
||||
|
||||
|
||||
// Turn off some annoying warnings
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(disable : 4018) // signed/unsigned comparison
|
||||
# pragma warning(disable : 4250) // VC++ 11.0: inheriting from std stream classes produces C4250 warning; \
|
||||
// see <http://connect.microsoft.com/VisualStudio/feedback/details/733720/inheriting-from-std-fstream-produces-c4250-warning>
|
||||
# pragma warning(disable : 4251) // ... needs to have dll-interface warning
|
||||
# pragma warning(disable : 4275) // non dll-interface class 'std::exception' used as base for dll-interface class 'Poco::Exception'
|
||||
# pragma warning( \
|
||||
disable : 4344) // behavior change: use of explicit template arguments results in call to '...' but '...' is a better match
|
||||
# pragma warning(disable : 4351) // new behavior: elements of array '...' will be default initialized
|
||||
# pragma warning(disable : 4355) // 'this' : used in base member initializer list
|
||||
# pragma warning(disable : 4675) // resolved overload was found by argument-dependent lookup
|
||||
# pragma warning(disable : 4996) // VC++ 8.0 deprecation warnings
|
||||
#endif
|
||||
|
||||
|
||||
// Enable C++11 support for VS 2010 and newer
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1700) && !defined(POCO_ENABLE_CPP11)
|
||||
# define POCO_ENABLE_CPP11
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__INTEL_COMPILER)
|
||||
# pragma warning(disable : 1738) // base class dllexport/dllimport specification differs from that of the derived class
|
||||
# pragma warning(disable : 1478) // function ... was declared "deprecated"
|
||||
# pragma warning(disable : 1744) // field of class type without a DLL interface used in a class with a DLL interface
|
||||
#endif
|
||||
|
||||
|
||||
#endif // Foundation_Platform_WIN32_INCLUDED
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user