Conditional compilation for macOS 在 macOS 上的条件编译

huangapple go评论64阅读模式
英文:

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)

huangapple
  • 本文由 发表于 2023年5月10日 17:05:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76216662.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定