aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-10 02:41:34 +0900
committernsfisis <nsfisis@gmail.com>2026-06-10 02:46:18 +0900
commit2d474e91e49c7343d28198eff2b5bbbed9afbcee (patch)
tree8c1ab321dfa5ddc1ca9d2871eb06a6fde6b2970b /crates/shirabe-php-shim
parente583112899cbea7494ffdd73d7de380dd5f808c4 (diff)
downloadphp-shirabe-2d474e91e49c7343d28198eff2b5bbbed9afbcee.tar.gz
php-shirabe-2d474e91e49c7343d28198eff2b5bbbed9afbcee.tar.zst
php-shirabe-2d474e91e49c7343d28198eff2b5bbbed9afbcee.zip
feat(phase-c): resolve cross-module phase-b TODOs
Diffstat (limited to 'crates/shirabe-php-shim')
-rw-r--r--crates/shirabe-php-shim/src/lib.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs
index f47e221..873f7f4 100644
--- a/crates/shirabe-php-shim/src/lib.rs
+++ b/crates/shirabe-php-shim/src/lib.rs
@@ -2477,3 +2477,16 @@ pub fn date_format_to_strftime(format: &str) -> &'static str {
other => panic!("Unsupported PHP date format: {other:?}"),
}
}
+
+// NOTE: &str matching in const expression does not compile for now.
+pub const PHP_OS: &str = match std::env::consts::OS.as_bytes() {
+ b"linux" => "Linux",
+ b"macos" => "Darwin",
+ b"windows" => "WINNT",
+ b"freebsd" => "FreeBSD",
+ b"openbsd" => "OpenBSD",
+ b"netbsd" => "NetBSD",
+ b"dragonfly" => "DragonFly",
+ b"solaris" | b"illumos" => "SunOS",
+ _ => std::env::consts::OS,
+};