Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You should be able to import everything, then use `when` to generate a unified constant name:

@(require) import "x_a"

@(require) import "x_b"

when ODIN_OS == .Windows { x :: x_a } else when ODIN_OS == .Linux { x :: x_b }

x.do_thing()



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: