Skip to content

Commit

Permalink
Emit compilation error when compiled for Windows targets
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed May 5, 2024
1 parent 54a96f7 commit 72139d2
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 21 deletions.
21 changes: 6 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions md5/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.5.2 (2024-05-06)
### Changed
- Emit compilation error when compiled for Windows targets. ([#79])

[#79]: https://github.com/RustCrypto/asm-hashes/pull/79

## 0.5.1 (2023-08-07)
### Changed
- Prefix x86 asm symbols with `_`` on Windows like on Apple ([#61])
Expand Down
2 changes: 1 addition & 1 deletion md5/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "md5-asm"
version = "0.5.1"
version = "0.5.2"
authors = ["RustCrypto Developers"]
license = "MIT"
description = "Assembly implementation of MD5 compression function"
Expand Down
3 changes: 3 additions & 0 deletions md5/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
compile_error!("crate can only be used on x86 and x86-64 architectures");

#[cfg(target_os = "windows")]
compile_error!("crate does not support Windows targets");

#[link(name = "md5", kind = "static")]
extern "C" {
fn md5_compress(state: &mut [u32; 4], block: &[u8; 64]);
Expand Down
8 changes: 7 additions & 1 deletion sha1/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.5.3 (2024-05-06)
### Changed
- Emit compilation error when compiled for Windows targets. ([#79])

[#79]: https://github.com/RustCrypto/asm-hashes/pull/79

## 0.5.2 (2023-08-07)
### Changed
- Prefix x86 asm symbols with `_`` on Windows like on Apple ([#61])
- Prefix x86 asm symbols with `_` on Windows like on Apple ([#61])
- Fix deprecated use of `cc::Build::compile` ([#59])

[#61]: https://github.com/RustCrypto/asm-hashes/pull/61
Expand Down
2 changes: 1 addition & 1 deletion sha1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sha1-asm"
version = "0.5.2"
version = "0.5.3"
authors = ["RustCrypto Developers"]
license = "MIT"
description = "Assembly implementation of SHA-1 compression function"
Expand Down
3 changes: 3 additions & 0 deletions sha1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")))]
compile_error!("crate can only be used on x86, x86_64 and AArch64 architectures");

#[cfg(target_os = "windows")]
compile_error!("crate does not support Windows targets");

#[link(name = "sha1", kind = "static")]
extern "C" {
fn sha1_compress(state: &mut [u32; 5], block: &[u8; 64]);
Expand Down
8 changes: 7 additions & 1 deletion sha2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.6.4 (2024-05-06)
### Changed
- Emit compilation error when compiled for Windows targets. ([#79])

[#79]: https://github.com/RustCrypto/asm-hashes/pull/79

## 0.6.3 (2023-08-07)
### Changed
- Prefix x86 asm symbols with `_`` on Windows like on Apple ([#61])
- Prefix x86 asm symbols with `_` on Windows like on Apple ([#61])

[#61]: https://github.com/RustCrypto/asm-hashes/pull/61

Expand Down
2 changes: 1 addition & 1 deletion sha2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sha2-asm"
version = "0.6.3"
version = "0.6.4"
authors = ["RustCrypto Developers"]
license = "MIT"
description = "Assembly implementation of SHA-2 compression functions"
Expand Down
3 changes: 3 additions & 0 deletions sha2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")))]
compile_error!("crate can only be used on x86, x86-64 and aarch64 architectures");

#[cfg(target_os = "windows")]
compile_error!("crate does not support Windows targets");

#[link(name = "sha256", kind = "static")]
extern "C" {
fn sha256_compress(state: &mut [u32; 8], block: &[u8; 64]);
Expand Down
6 changes: 6 additions & 0 deletions whirlpool/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.6.2 (2024-05-06)
### Changed
- Emit compilation error when compiled for Windows targets. ([#79])

[#79]: https://github.com/RustCrypto/asm-hashes/pull/79

## 0.6.1 (2023-08-07)
### Changed
- Prefix x86 asm symbols with `_`` on Windows like on Apple ([#61])
Expand Down
2 changes: 1 addition & 1 deletion whirlpool/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "whirlpool-asm"
version = "0.6.1"
version = "0.6.2"
authors = ["RustCrypto Developers"]
license = "MIT"
description = "Assembly implementation of Whirlpool compression function"
Expand Down
3 changes: 3 additions & 0 deletions whirlpool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
compile_error!("crate can only be used on x86 and x86-64 architectures");

#[cfg(target_os = "windows")]
compile_error!("crate does not support Windows targets");

#[link(name = "whirlpool", kind = "static")]
extern "C" {
fn whirlpool_compress(state: &mut [u64; 8], block: &[u8; 64]);
Expand Down

0 comments on commit 72139d2

Please sign in to comment.