]> Repositorios git - scryer-prolog.git/commitdiff
Fix not compiling without hostname feature
authorbakaq <[email protected]>
Sun, 29 Sep 2024 19:50:06 +0000 (16:50 -0300)
committerbakaq <[email protected]>
Sun, 29 Sep 2024 19:51:11 +0000 (16:51 -0300)
src/machine/system_calls.rs

index a092633ec10f5ee321fc69ce27427cd42f370c6c..89ce227274fc5dbe699ab3c6a6688de296148f85 100644 (file)
@@ -1772,7 +1772,7 @@ impl Machine {
         self.machine_st.fail = true;
     }
 
-    #[cfg(not(target_arch = "wasm32"))]
+    #[cfg(all(not(target_arch = "wasm32"), feature = "hostname"))]
     #[inline(always)]
     pub(crate) fn current_hostname(&mut self) {
         if let Ok(host) = hostname::get() {
@@ -1789,7 +1789,7 @@ impl Machine {
         self.machine_st.fail = true;
     }
 
-    #[cfg(target_arch = "wasm32")]
+    #[cfg(any(target_arch = "wasm32", not(feature = "hostname")))]
     pub(crate) fn current_hostname(&mut self) {
         unimplemented!()
     }