Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OSX 支持补丁 #4

Merged
merged 3 commits into from
Nov 29, 2012
Merged

Mac OSX 支持补丁 #4

merged 3 commits into from
Nov 29, 2012

Conversation

cofyc
Copy link
Contributor

@cofyc cofyc commented Nov 27, 2012

hi, 云风

我现在在阅读 skynet 的源码,出于个人兴趣,打了补丁让其可以在 mac 上可以编译。

共有三方面修改:

  • epoll/kqueue 兼容

gate/mread.c 更新了最新的 git://github.com/cloudwu/mread.git 的 kqueue 支持 (mread 我提交了移除 trailing space 的 pull request,为了方便 diff)
connection/connection.c 增加 kqueue 支持

  • Makefile

gcc/ld 参数自动调节

  • clock_gettime 兼容

clock_gettime(CLOCK_THREAD_CPUTIME_ID, ...) 使用 task_info 实现
clock_gettime(CLOCK_MONOTONIC,...) 使用 gettimeofday 实现

在 10.8 上编译并测试 simpledb 成功。至少简单的调试在 mac 上没有问题了 ;-)

@cofyc
Copy link
Contributor Author

cofyc commented Nov 27, 2012

P.S.

发现还不完善。

我看 http://developer.apple.com/library/mac/#documentation/developertools/gcc-4.2.1/gcc/Atomic-Builtins.html 上面,macosx 的 gcc 也支持这些 _sync* atomic opeartions。但是 mac 上编译的版本会不断报:

[0] A message from [ :00000000 ] to [ :01000002 ] maybe in an endless loop

错误。

还在排查中。

@cofyc
Copy link
Contributor Author

cofyc commented Nov 27, 2012

bug 修复了。。。

mread 我也提交了对应的 pull request

cloudwu added a commit that referenced this pull request Nov 29, 2012
@cloudwu cloudwu merged commit 8ce0211 into cloudwu:master Nov 29, 2012
@flashjay flashjay mentioned this pull request Apr 26, 2014
@flashjay flashjay mentioned this pull request Jun 25, 2015
@xzzwandi xzzwandi mentioned this pull request Apr 10, 2018
@chengdd1987 chengdd1987 mentioned this pull request May 2, 2018
@DeanHH DeanHH mentioned this pull request Aug 23, 2018
@kuro-karasu kuro-karasu mentioned this pull request Jul 27, 2020
coolflyreg added a commit to coolflyreg/skynet that referenced this pull request Aug 24, 2021
@RiceCN RiceCN mentioned this pull request Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants