首頁  >  問答  >  主體

nginx 來源碼頭檔案包含為什麼是 < >, 而不是" "

在看nginx 原始碼是看到頭檔包含都是使用#include <ngx_core.h> #include <nginx.h> 類似格式, 在IDE 中會錯誤找不到檔案
這些檔案不是在系統目錄裡,為什麼要使用"<>"

巴扎黑巴扎黑2713 天前364

全部回覆(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
  • 取消回覆