首页  >  问答  >  正文

nginx 源码头文件包含为什么是 < >, 而不是" "

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

巴扎黑巴扎黑2713 天前363

全部回复(1)我来回复

  • 巴扎黑

    巴扎黑2017-05-16 17:20:11

    以下节选自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语言编译器五花八门。

    回复
    0
  • 取消回复