1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! # Process Listing
//! This crate exposes utilities to deal sequentially with processes and their modules.
//!
//! Examples are found on the function definitions.
//!
//! # Support
//! For now only Windows is supported, but it should be simple enough to port on other operating systems.
//!
//! It's not a priority but pull requests are well accepted.

// We need macros **BEFORE** defining the modules that use them
#[allow(unused)]
macro_rules! trace { ($($x:tt)*) => (
    {
        #[cfg(feature = "log")] {
            log::trace!($($x)*)
        }

        #[cfg(not(feature = "log"))]{
            let _ = format_args!($($x)*);
        }
    }
) }
#[allow(unused)]
macro_rules! debug { ($($x:tt)*) => (
    {
        #[cfg(feature = "log")] {
            log::debug!($($x)*)
        }

        #[cfg(not(feature = "log"))]{
            let _ = format_args!($($x)*);
        }
    }
) }
#[allow(unused)]
macro_rules! info { ($($x:tt)*) => (
    {
        #[cfg(feature = "log")] {
            log::info!($($x)*)
        }

        #[cfg(not(feature = "log"))]{
            let _ = format_args!($($x)*);
        }
    }
) }
#[allow(unused)]
macro_rules! warn { ($($x:tt)*) => (
    {
        #[cfg(feature = "log")] {
            log::warn!($($x)*)
        }

        #[cfg(not(feature = "log"))]{
            let _ = format_args!($($x)*);
        }
    }
) }
#[allow(unused)]
macro_rules! error { ($($x:tt)*) => (
    {
        #[cfg(feature = "log")] {
            log::error!($($x)*)
        }

        #[cfg(not(feature = "log"))]{
            let _ = format_args!($($x)*);
        }
    }
) }

#[cfg(target_os = "windows")]
mod windows;

#[cfg(target_os = "windows")]
pub use windows::*;