Reading Zend Engine API code: What does ## (double hash) mean?

我是研究僧i 提交于 2019-11-28 23:09:00

The ## concatenates what's before the ## with what's after it. So in your example doing ZEND_FN(foo) would result in zif_foo

Echo RvV's answer.

Be aware that when concatenating literal strings you may find some inconsistencies between pre-processors/compilers. Some will require the ##

#define STR_CAT(s1, s2)   s1 ## s2

as in

const char s[] = STR_CAT("concat", "enation")

whereas other will baulk at it, and instead just require that the two literals will be joined by the compiler (as opposed to the pre-processor), so will require

#define STR_CAT(s1, s2)   s1 s2

HTH

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!