summaryrefslogtreecommitdiffstats
path: root/vendor/sysinfo/src/windows/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sysinfo/src/windows/macros.rs')
-rw-r--r--vendor/sysinfo/src/windows/macros.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/sysinfo/src/windows/macros.rs b/vendor/sysinfo/src/windows/macros.rs
new file mode 100644
index 000000000..b0c024c7c
--- /dev/null
+++ b/vendor/sysinfo/src/windows/macros.rs
@@ -0,0 +1,16 @@
+// Take a look at the license at the top of the repository in the LICENSE file.
+
+/// Allows to cast only when needed.
+#[macro_export]
+macro_rules! auto_cast {
+ ($t:expr, $cast:ty) => {{
+ #[cfg(target_pointer_width = "32")]
+ {
+ $t as $cast
+ }
+ #[cfg(not(target_pointer_width = "32"))]
+ {
+ $t
+ }
+ }};
+}