nginx 源码头文件包含为什么是 < >, 而不是" "
巴扎黑
巴扎黑 2017-05-16 17:18:11
0
1
362

在看nginx 源码是看到头文件包含都是 使用 #include <ngx_core.h> #include <nginx.h> 类似格式, 在 IDE 中会报错找不到文件
这些文件不是在系统目录里,为什么要使用 "<>"

巴扎黑
巴扎黑

全部回复(1)
巴扎黑

以下节选自ISO/IEC 9899:1999原文:

# include <h-char-sequence> new-line
searches a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the < and > delimiters, and causes the replacement of that directive by the entire contents of the header.

How the places are specified or the header identified is implementation-defined.

注意到最后了吗,implementation-defined——没人规定说就是系统目录,而且很多编译器的默认行为也不是仅查找系统目录。即使是同一种编译器,具体的行为尚且可能取决于你提供的选项呢,何况C语言编译器五花八门。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!