英文:
Conditional compilation for macOS
问题
使用 {-# LANGUAGE CPP #-},我可以使用 #ifdef 来检查当前是否在 macOS 编译吗?
我尝试过 __APPLE__ 和其他方式,并搜索了答案,但未找到。
英文:
Using {-# LANGUAGE CPP #-}, is there a preprocessor define I can #ifdef to check whether current compilation is for macOS?
I tried __APPLE__ and others as well as googling for answers but couldn't find it.
答案1
得分: 2
The definition appears to be darwin_HOST_OS! (found it by guessing based on this answer to a similar question)
英文:
The definition appears to be darwin_HOST_OS! (found it by guessing based on this answer to a similar question)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论