gpt4 book ai didi

macruby - 你如何从 MacRuby 调用 C 函数?

转载 作者:行者123 更新时间:2023-12-01 13:03:20 24 4
gpt4 key购买 nike

我想尝试在 OS X 上将 MacRuby 与 CoreAudio 结合使用,但大多数 API 都是 C 函数。我必须使用 Ruby DL,还是 MacRuby 提供另一种方式?

最佳答案

根据 Macruby 站点,您应该能够直接调用 C 函数

Accessing Static APIs

Many Mac OS X framework APIs are not introspectable because they are static, but thanks to the BridgeSupport project, static APIs can be called from MacRuby.

The following API types are available:

  • List item
  • CoreFoundation types (CFType)
  • C structures
  • C opaque types
  • C enumerations
  • C and Objective-C constants (including preprocessor-defined constants)
  • C functions (including inline functions)
  • Objective-C informal protocols

http://www.macruby.org/documentation/tutorial.html

关于macruby - 你如何从 MacRuby 调用 C 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4540283/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com