in same time?
                  
                  
                  
                  
                  
                  Something like
                  
                  
                  #[cfg(target_os = ("linux", "macos"))]
                  
                  
                
won't #[cfg(unix)] work for your case?
 Jacob
                          
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Jacob
                          
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  No, it doesn't work on ubuntu, and in general I'm looking for this solution for other macros as well
wdym it doesn't work on ubuntu? ubuntu is linux, hence is unix if you really want to say "only on linux or macos", you can use #[cfg(any(target_os = "linux", target_os = "macos")], see https://doc.rust-lang.org/reference/conditional-compilation.html
 Jacob
                          
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Jacob
                          
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  Looks great thank you. following that question, does it possible to make block of code after that? like #[cfg(something)] { const SOME_STATIC = ...; const ANOTHER_STATIC = ...; }
 Jacob
                          
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Jacob
                          
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                   Yes
                      
                      Yes
                    on the top level, you'll have to apply the cfg to each item separately, sadly
Обсуждают сегодня